快捷方式

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) – 要使用的影像分割。可以是 traintest10fold(預設)。

  • image_set (str, optional) – 要使用的影像剪輯型別,originalfunneleddeepfunneled。預設為 funneled

  • transform (callable, optional) – 一個函式/變換,接收 PIL 影像或 torch.Tensor(取決於給定的載入器),並返回一個變換後的版本。例如,transforms.RandomCrop

  • target_transform (可呼叫物件, 可選) – 一個函式/變換,接受目標並對其進行變換。

  • download (bool, optional) – 不再支援,請保持為 False。

  • loader (callable, optional) – 一個載入給定路徑的影像的函式。預設情況下,它使用 PIL 作為影像載入器,但使用者也可以傳入 torchvision.io.decode_image 以直接將影像資料解碼為張量。

特殊成員:

__getitem__(index: int) tuple[Any, Any][原始碼]
引數:

index (int) – 索引

返回:

元組 (image, target),其中 target 是該人的身份。

返回型別:

元組

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源