Shortcuts

WIDERFace

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

WIDERFace Dataset.

Parameters
  • root (string) –

    Root directory where images and annotations are downloaded to. Expects the following folder structure if 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) – The dataset split to use. One of {train, val, test}. Defaults to train.

  • transform (callable, optional) – A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.RandomCrop

  • target_transform (callable, optional) – A function/transform that takes in the target and transforms it.

  • download (bool, optional) – If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.

Special-members

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

index (int) – Index

Returns

(image, target) where target is a dict of annotations for all faces in the image. target=None for the test split.

Return type

tuple

Docs

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