快捷方式

Places365

class torchvision.datasets.Places365(root: ~typing.Union[str, ~pathlib.Path], split: str = 'train-standard', small: bool = False, download: bool = False, transform: ~typing.Optional[~typing.Callable] = None, target_transform: ~typing.Optional[~typing.Callable] = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]

Places365 分類資料集。

引數:
  • root (str or pathlib.Path) – Places365 資料集的根目錄。

  • split (string, optional) – 資料集劃分。可以是 train-standard (預設)、train-challengevaltest 之一。

  • small (bool, optional) – 如果為 True,則使用小尺寸影像,即調整為 256 x 256 畫素,而不是高解析度影像。

  • download (bool, optional) – 如果為 True,則下載資料集元件並將其放置在 root 中。已下載的壓縮包不會再次下載。

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

  • target_transform (callable, optional) – 一個函式/轉換,接受目標並對其進行轉換。

  • loader – 一個根據路徑載入影像的函式。

引發:
  • RuntimeError – 如果 download is False 且元檔案(即 devkit)不存在或已損壞。

  • RuntimeError – 如果 download is True 且影像壓縮包已解壓。

特殊成員:

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

index (int) – 索引

返回:

樣本和元資料,可選地透過相應的轉換進行轉換。

返回型別:

(Any)

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

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

檢視資源