SBDataset¶
- class torchvision.datasets.SBDataset(root: Union[str, Path], image_set: str = 'train', mode: str = 'boundaries', download: bool = False, transforms: Optional[Callable] = None)[source]¶
-
The SBD currently contains annotations from 11355 images taken from the PASCAL VOC 2011 dataset.
Note
Please note that the train and val splits included with this dataset are different from the splits in the PASCAL VOC dataset. In particular some “train” images might be part of VOC2012 val. If you are interested in testing on VOC 2012 val, then use image_set=’train_noval’, which excludes all val images.
Warning
This class needs scipy to load target files from .mat format.
- Parameters:
root (str or
pathlib.Path
) – Root directory of the Semantic Boundaries Datasetimage_set (string, optional) – Select the image_set to use,
train
,val
ortrain_noval
. Image settrain_noval
excludes VOC 2012 val images.mode (string, optional) – Select target type. Possible values ‘boundaries’ or ‘segmentation’. In case of ‘boundaries’, the target is an array of shape [num_classes, H, W], where num_classes=20.
download (bool, optional) – If true, downloads the dataset from the internet and puts it in root directory. If dataset is already downloaded, it is not downloaded again.
transforms (callable, optional) – A function/transform that takes input sample and its target as entry and returns a transformed version. Input sample is PIL image and target is a numpy array if mode=’boundaries’ or PIL image if mode=’segmentation’.
- Special-members: