捷徑

PCAM

class torchvision.datasets.PCAM(root: Union[str, Path], split: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]

PCAM 資料集.

PatchCamelyon 資料集是一個二元分類資料集,包含 327,680 張彩色圖像 (96px x 96px),取自淋巴結切片的組織病理學掃描。每張圖像都標記有一個二元標籤,指示是否存在轉移性組織。

此資料集需要 h5py 套件,您可以使用 pip install h5py 來安裝。

參數:
  • root (str 或 pathlib.Path) – 資料集的根目錄。

  • split (字串, 選用) – 資料集分割,支援 "train" (預設), "test""val"

  • transform (callable, 選用) – 一個函數/轉換,它接收 PIL 影像並回傳轉換後的版本。 例如, transforms.RandomCrop

  • target_transform (callable, 選用) – 一個函數/轉換,它接收目標並轉換它。

  • download (bool, 選用) –

    如果為 True,則從網際網路下載資料集並將其放入 root/pcam。 如果已下載資料集,則不會再次下載。

    警告

    要下載資料集,需要 gdown

特殊成員:

__getitem__(idx: int) Tuple[Any, Any][source]
參數:

index (int) – 索引

回傳:

樣本和元數據,可選擇透過各自的轉換進行轉換。

回傳類型:

(Any)

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources