快捷方式

VOCSegmentation

torchvision.datasets.VOCSegmentation(root: Union[str, Path], year: str = '2012', image_set: str = 'train', download: bool = False, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, transforms: Optional[Callable] = None)[來源]

Pascal VOC 分割資料集。

引數:
  • root (str 或 pathlib.Path) – VOC 資料集的根目錄。

  • year (string, 可選) – 資料集年份,支援 "2007""2012" 年。

  • image_set (string, 可選) – 選擇要使用的 image_set,"train""trainval""val"。如果 year=="2007",也可以是 "test"

  • download (bool, 可選) – 如果為 True,則從網際網路下載資料集並將其放在根目錄中。如果資料集已下載,則不會再次下載。

  • transform (callable, 可選) – 一個函式/變換,接收 PIL 影像並返回變換後的版本。例如,transforms.RandomCrop

  • target_transform (callable, 可選) – 一個函式/變換,接收目標並對其進行變換。

  • transforms (callable, 可選) – 一個函式/變換,接收輸入樣本及其目標作為輸入,並返回變換後的版本。

特殊成員:

__getitem__(index: int) Tuple[Any, Any][來源]
引數:

index (int) – 索引

返回:

(image, target),其中 target 是影像分割。

返回型別:

元組

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並解答你的疑問

檢視資源