公开预览版:仅展示平台目录与原作者卡片,不提供下载;院内智能体通过内网实例申请使用。

🔒 StanfordAIMI/CheXpert-v1.0-512

以下为作者原文,图片与外部链接在院内网络不可用。

来源说明:官方 = 数据集作者/机构本人上传;完整转存 = 第三方原样转存;处理版 = 第三方子集、切片或格式转换(可能与原始数据不同)。许可以仓库声明为准,第三方转存的原始许可由工作人员下载前核对。

Around 30GB (dataset) and 8 GB (saved jpg)

from datasets import load_dataset
import os

# Define the dataset name and the splits you want to download
dataset_name = 'StanfordAIMI/CheXpert-v1.0-512'
splits = ['train']  # You can add more splits if available

# Define the output directory
output_dir = 'CheXpert-v1.0-512'

# Iterate over each split
for split in splits:
    print(f"Processing split: {split}")
    # Load the dataset split
    dataset = load_dataset(dataset_name, split=split)

    # Iterate over each item in the dataset
    for idx, item in enumerate(dataset):
        # Extract the path and image
        path = item['path']  # e.g., 'train/patient00001/study1/view1_frontal.jpg'
        image = item['image']  # PIL Image

        # Create the full output path
        full_path = os.path.join(output_dir, path)

        # Ensure the directory exists
        os.makedirs(os.path.dirname(full_path), exist_ok=True)

        # Save the image as JPEG
        image.save(full_path, format='JPEG', quality=100, subsampling=0)

        # Optional: Print progress every 1000 images
        if idx % 1000 == 0:
            print(f"Saved {idx} images from split {split}")