LFWPeople¶
- class torchvision.datasets.LFWPeople(root: str, split: str = '10fold', image_set: str = 'funneled', transform: ~typing.Optional[~typing.Callable] = None, target_transform: ~typing.Optional[~typing.Callable] = None, download: bool = False, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[源代码]¶
LFW 数据集。
- 参数:
root (str 或
pathlib.Path
) – 数据集根目录,其中lfw-py
目录存在或将在 download 设置为 True 时被保存。split (str, optional) – 要使用的图像分割。可以是
train
、test
、10fold
(默认)。image_set (str, optional) – 要使用的图像剪辑类型,
original
、funneled
或deepfunneled
。默认为funneled
。transform (callable, optional) – 一个函数/变换,接收 PIL 图像或 torch.Tensor(取决于给定的加载器),并返回一个变换后的版本。例如,
transforms.RandomCrop
target_transform (可调用对象, 可选) – 一个函数/变换,接受目标并对其进行变换。
download (bool, optional) – 不再支持,请保持为 False。
loader (callable, optional) – 一个加载给定路径的图像的函数。默认情况下,它使用 PIL 作为图像加载器,但用户也可以传入
torchvision.io.decode_image
以直接将图像数据解码为张量。
- 特殊成员: