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)[source]¶
Caltech 101 資料集。
警告
此類需要 scipy 來載入 .mat 格式的目標檔案。
- 引數:
root (str 或
pathlib.Path) – 資料集的根目錄,其中目錄caltech101存在,或者如果 download 設定為 True,將儲存到此處。target_type (string 或 list, 可選) – 要使用的目標型別,
category或annotation。也可以是一個列表,用於輸出包含所有指定目標型別的元組。category表示目標類別,而annotation是手繪輪廓的點列表。預設為category。transform (callable, 可選) – 一個接收 PIL 影像並返回變換後版本的函式/變換。例如,
transforms.RandomCroptarget_transform (callable, 可選) – 一個接收目標並對其進行變換的函式/變換。
download (bool, 可選) –
如果為 True,則從網際網路下載資料集並將其放入 root 目錄。如果資料集已經下載,則不會再次下載。
警告
下載資料集需要 gdown。
- 特殊成員: