SVHN — Torchvision 0.22 documentation (original) (raw)

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

SVHN Dataset. Note: The SVHN dataset assigns the label 10 to the digit 0. However, in this Dataset, we assign the label 0 to the digit 0 to be compatible with PyTorch loss functions which expect the class labels to be in the range [0, C-1]

Warning

This class needs scipy to load data from .mat format.

Parameters:

Special-members:

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

Parameters:

index (int) – Index

Returns:

(image, target) where target is index of the target class.

Return type:

tuple