快速鍵

GTSRB

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

German Traffic Sign Recognition Benchmark (GTSRB) 資料集。

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

  • split (string, optional) – 資料集分割,支援 "train" (預設),或 "test"

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

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

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

特殊成員:

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

index (int) – 索引

傳回:

樣本和元資料,可選擇通過各自的轉換進行轉換。

傳回類型:

(Any)

文件

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