OxfordIIITPet¶
- class torchvision.datasets.OxfordIIITPet(root: Union[str, Path], split: str = 'trainval', target_types: Union[Sequence[str], str] = 'category', transforms: Optional[Callable] = None, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[原始碼]¶
-
- 引數:
root (str 或
pathlib.Path) – 資料集的根目錄。split (str, optional) – 資料集劃分,支援
"trainval"(預設) 或"test"。target_types (str, sequence of str, optional) –
要使用的目標的型別。可以是
category(預設) 或segmentation。也可以是列表,以輸出包含所有指定目標型別的元組。型別表示:category(int):37 種寵物類別之一的標籤。binary-category(int):貓或狗的二元標籤。segmentation(PIL image):影像的分割三圖。
如果為空,則返回
None作為目標。transform (callable, optional) – 一個函式/變換,接收 PIL 影像並返回一個變換後的版本。例如,
transforms.RandomCrop。target_transform (可呼叫物件, 可選) – 一個函式/變換,接受目標並對其進行變換。
transforms (callable, optional) – 接受輸入樣本及其目標並返回轉換後版本的函式/轉換。
download (bool, optional) – 如果為 True,則從網際網路下載資料集並將其放入
root/oxford-iiit-pet。如果資料集已下載,則不會再次下載。
- 特殊成員: