快捷鍵

VOCDetection

class torchvision.datasets.VOCDetection(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,則從網際網路下載資料集並將其放入根目錄。如果資料集已下載,則不會再次下載。(預設值:VOC 20 個類別的字母順序索引)。

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

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

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

特殊成員:

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

index (int) – 索引

傳回:

(image, target),其中 target 是 XML 樹的字典。

傳回類型:

tuple

文件

取得 PyTorch 的完整開發人員文件

檢視文件

教學

取得初學者和進階開發人員的深入教學課程

檢視教學課程

資源

尋找開發資源並取得您問題的解答

檢視資源