快捷方式

Omniglot

class torchvision.datasets.Omniglot(root: Union[str, Path], background: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]

Omniglot 資料集。

參數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,其中存在 omniglot-py 目錄。

  • background (bool, optional) – 如果為 True,則從「背景」集建立資料集,否則從「評估」集建立。此術語由作者定義。

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

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

  • download (bool, optional) – 如果為 true,則從網際網路下載資料集 zip 檔案,並將其放置在根目錄中。 如果已經下載了 zip 檔案,則不會再次下載。

特殊成員:

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

index (int) – 索引

傳回:

(image, target),其中 target 是目標字元類別的索引。

傳回類型:

tuple (元組)

文件

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