快捷方式

SEMEION

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

SEMEION 資料集。

引數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,其中包含 semeion.py 檔案。

  • transform (callable, 可選) – 一個函式/轉換,輸入 PIL 影像並返回轉換後的版本。例如,transforms.RandomCrop

  • target_transform (callable, 可選) – 一個函式/轉換,輸入目標並對其進行轉換。

  • download (bool, 可選) – 如果為 True,則從網際網路下載資料集並將其放在 root 目錄中。如果資料集已下載,則不再重複下載。

特殊成員:

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

index (int) – 索引

返回:

(影像, 目標),其中目標是目標類別的索引。

返回型別:

tuple

文件

查閱 PyTorch 的完整開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源