CocoDetection¶
- class torchvision.datasets.CocoDetection(root: Union[str, Path], annFile: str, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, transforms: Optional[Callable] = None)[source]¶
MS Coco Detection 資料集。
它需要安裝 COCO API。
- 參數:
root (str 或
pathlib.Path
) – 影像下載到的根目錄。annFile (string) – json 註釋檔案的路徑。
transform (callable, optional) – 接收 PIL 影像並傳回轉換版本的函式/轉換。例如,
transforms.PILToTensor
target_transform (callable, optional) – 接收目標並轉換它的函式/轉換。
transforms (callable, optional) – 一個函數/轉換,它接受輸入樣本及其目標作為條目,並返回轉換後的版本。
使用
CocoDetection
的範例- 特殊成員: