Caltech101¶
- class torchvision.datasets.Caltech101(root: Union[str, Path], target_type: Union[list[str], str] = 'category', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[原始碼]¶
Caltech 101 資料集。
警告
此類需要 scipy 來從 .mat 格式載入目標檔案。
- 引數:
root (str 或
pathlib.Path) – 資料集的根目錄,其中caltech101目錄已存在或將在 download 設定為 True 時建立。target_type (string 或 list, optional) – 使用的目標型別,
category或annotation。也可以是一個列表,以輸出包含所有指定目標型別的元組。category表示目標類別,annotation是手工生成的輪廓點列表。預設為category。transform (callable, optional) – 一個函式/變換,接受 PIL 影像並返回變換後的版本。例如,
transforms.RandomCroptarget_transform (可呼叫物件, 可選) – 一個函式/變換,接受目標並對其進行變換。
download (bool, optional) –
如果為 true,則從網際網路下載資料集並將其放入根目錄。如果資料集已下載,則不再下載。
警告
下載資料集需要 gdown。
- 特殊成員: