快捷方式

Kitti

class torchvision.datasets.Kitti(root: Union[str, Path], train: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, transforms: Optional[Callable] = None, download: bool = False)[原始碼]

KITTI 資料集。

它對應於“物體左側彩色影像”資料集,用於物體檢測。

引數:
  • root (str 或 pathlib.Path) –

    圖片下載到的根目錄。如果 download=False,則需要以下資料夾結構

    <root>
        └── Kitti
            └─ raw
                ├── training
                |   ├── image_2
                |   └── label_2
                └── testing
                    └── image_2
    

  • train (bool, 可選) – 如果為 true,則使用 train 分割集,否則使用 test 分割集。預設為 train

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

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

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

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

特殊成員:

__getitem__(index: int) Tuple[Any, Any][原始碼]

獲取給定索引處的項。

引數:

index (int) – 索引

返回:

(image, target),其中 target 是一個字典列表,包含以下鍵:

  • type: str

  • truncated: float

  • occluded: int

  • alpha: float

  • bbox: float[4]

  • dimensions: float[3]

  • locations: float[3]

  • rotation_y: float

返回型別:

tuple

文件

獲取 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源