快捷方式

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 (可调用对象, 可选) – 一个函数/变换,接受目标并对其进行变换。

  • download (bool, 可选) –

    如果为 true,则从互联网下载数据集并将其放入根目录。如果数据集已下载,则不再下载。

    警告

    下载数据集需要 gdown

特殊成员:

__getitem__(index: int) tuple[Any, Any][源代码]
参数:

index (int) – 索引

返回:

(image, target),其中 target 是图像中所有人脸的注释字典。对于测试集,target=None。

返回类型:

元组

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

为初学者和高级开发者提供深入的教程

查看教程

资源

查找开发资源并让您的问题得到解答

查看资源