捷徑

LFWPeople

class torchvision.datasets.LFWPeople(root: str, split: str = '10fold', image_set: str = 'funneled', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[來源]

LFW 資料集。

參數:
  • root (str 或 pathlib.Path) – 資料集的根目錄,如果將 download 設置為 True,則目錄 lfw-py 存在或將保存到該目錄。

  • split (string, optional) – 要使用的圖像分割。可以是 traintest10fold (預設) 之一。

  • image_set (str, optional) – 要使用的圖像漏斗類型,originalfunneleddeepfunneled。預設為 funneled

  • transform (callable, optional) – 一個函數/轉換,它接收 PIL 圖像並返回轉換後的版本。例如,transforms.RandomRotation

  • target_transform (callable, optional) – 一個函數/轉換,它接收目標並轉換它。

  • download (bool, optional) – 如果為真,則從網路下載資料集並將其放入根目錄。如果資料集已下載,則不會再次下載。

特殊成員:

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

index (int) – 索引

回傳:

Tuple (圖像, 目標),其中目標是人物的身分。

回傳類型:

tuple

文件

Access comprehensive developer documentation for PyTorch

查看文件

教程

Get in-depth tutorials for beginners and advanced developers

查看教程

資源

Find development resources and get your questions answered

查看資源