捷徑

VOCSegmentation

class 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)[source]

Pascal VOC 分割資料集。

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

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

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

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

  • transform (callable, optional) – 接收 PIL 影像並傳回轉換後版本的函數/轉換。 例如,transforms.RandomCrop

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

  • transforms (callable, optional) – 接收輸入樣本及其目標作為輸入並傳回轉換後版本的函數/轉換。

特殊成員:

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

index (int) – 索引

傳回:

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

傳回類型:

tuple

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources