捷徑

SBU

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

SBU 標題照片資料集。

參數:
  • root (str 或 pathlib.Path) – tarball SBUCaptionedPhotoDataset.tar.gz 存在的資料集根目錄。

  • transform (callable, optional) – 接收 PIL 影像並傳回轉換版本的函數/轉換。例如,transforms.RandomCrop

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

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

特殊成員:

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

index (int) – 索引

傳回:

(image, target),其中 target 是照片的說明文字。

傳回類型:

tuple (元組)

文件

取得 PyTorch 的完整開發者文件

檢視文件

教學

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

檢視教學

資源

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

檢視資源