快速鍵

SUN397

class torchvision.datasets.SUN397(root: Union[str, Path], transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[原始碼]

SUN397 資料集.

SUN397 或場景理解 (SUN) 是一個用於場景辨識的資料集,包含 397 個類別和 108'754 個圖像。

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

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

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

  • download (bool, optional) – 如果為 True,則從網路下載資料集並將其放入根目錄中。 如果已下載資料集,則不會再次下載。

特殊成員:

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

index (int) – 索引

傳回值:

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

傳回值類型:

(Any)

文件

存取 PyTorch 的全面開發者文件

查看文件

教學

取得初學者和進階開發者的深入教學

查看教學

資源

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

查看資源