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.RandomCrop
target_transform (callable, optional) – 一個函數/轉換,接受目標並轉換它。
download (bool, optional) –
如果為 true,則從網際網路下載資料集並將其放入根目錄。如果已下載資料集,則不會再次下載。
警告
要下載資料集,需要安裝 gdown。
- Special-members: