快捷方式

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>)[原始碼]

Places365 分類資料集。

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

  • split (字串, 可選) – 資料集分割。可以是以下之一:train-standard (預設)、train-challengevaltest

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

  • download (bool, 可選) – 如果設定為 True,則下載資料集元件並將其放置在 root 目錄中。已下載的存檔不會重複下載。

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

  • target_transform (可呼叫物件, 可選) – 一個函式/變換,接受目標並對其進行變換。

  • loader – 一個用於載入影像(給定其路徑)的函式。

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

  • RuntimeError – 如果 download True 且影像存檔已解壓。

特殊成員:

__getitem__(index: int) tuple[Any, Any][原始碼]
引數:

index (int) – 索引

返回:

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

返回型別:

(Any)

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源