快捷方式

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-challengeval 之一。

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

  • download (布林, 選用) – 如果 True,則下載資料集元件並將它們放置在 root 中。已經下載的封存檔不會再次下載。

  • transform (可呼叫物件, 選用) – 一個函式/轉換,它接受 PIL 影像並傳回轉換後的版本。例如,transforms.RandomCrop

  • target_transform (可呼叫物件, 選用) – 一個函式/轉換,它接受目標並轉換它。

  • loader – 一個用來載入影像的函式,給定其路徑。

引發:
  • RuntimeError – 如果 download is False 並且 meta 檔案(即開發套件)不存在或已損壞。

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

特殊成員:

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

index (int) – 索引

傳回:

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

傳回類型:

(Any)

文件

存取 PyTorch 的完整開發人員文件

檢視文件

教學

取得適合初學者和進階開發人員的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源