快捷方式

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, optional) –

    如果為 true,則從網際網路下載資料集並將其放入根目錄。如果資料集已下載,則不再下載。

    警告

    下載資料集需要 gdown

特殊成員:

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

index (int) – 索引

返回:

(image, target) 其中 target 是影像中所有面部註釋的字典。test split 的 target=None。

返回型別:

元組

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源