快捷方式

WIDERFace

class torchvision.datasets.WIDERFace(root: Union[str, Path], split: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[原始碼]

WIDERFace 資料集。

參數:
  • root (str 或 pathlib.Path) –

    下載影像和註解的根目錄。如果 download=False,則需要以下資料夾結構

    <root>
        └── widerface
            ├── wider_face_split ('wider_face_split.zip' if compressed)
            ├── WIDER_train ('WIDER_train.zip' if compressed)
            ├── WIDER_val ('WIDER_val.zip' if compressed)
            └── WIDER_test ('WIDER_test.zip' if compressed)
    

  • split (string) – 要使用的資料集分割。其中一個 {train, val, test}。預設為 train

  • transform (callable, optional) – 一個函數/轉換,它接收一個 PIL 圖像並返回一個轉換後的版本。例如,transforms.RandomCrop

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

  • download (bool, optional) –

    如果為 true,則從網路下載數據集並將其放入根目錄中。如果數據集已下載,則不會再次下載。

    警告

    要下載數據集,需要 gdown

特殊成員:

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

index (int) – 索引

返回值:

(image, target),其中 target 是一個包含圖像中所有面孔的註釋的字典。對於測試集,target=None。

返回類型:

tuple

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources