快捷方式

WIDERFace

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 数据集。

参数:
  • 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

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得问题解答

查看资源