WIDERFace — Torchvision 0.22 documentation (original) (raw)
class torchvision.datasets.WIDERFace(root: Union[str, Path], split: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]¶
WIDERFace Dataset.
Parameters:
- root (str or
pathlib.Path
) –
Root directory where images and annotations are downloaded to. Expects the following folder structure if download=False: └── 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 totrain
. - 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.
Warning
To download the dataset gdown is required.
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: