trw.datasets.voc

Module Contents

Functions

_load_image_and_mask(batch, transform, normalize_0_1=True)

_parse_voc_xml(node)

Extracted from torchvision

_load_image_and_bb(batch, transform, normalize_0_1=True)

default_voc_transforms()

create_voc_segmentation_dataset(batch_size: int = 40, root: Optional[str] = None, transform_train: Optional[List[trw.transforms.Transform]] = default_voc_transforms(), transform_valid: Optional[List[trw.transforms.Transform]] = None, nb_workers: int = 2, year: typing_extensions.Literal[2007, 2012] = '2012') → trw.basic_typing.Datasets

Create the VOC segmentation dataset

create_voc_detection_dataset(root: str = None, transform_train: Optional[List[trw.transforms.Transform]] = None, transform_valid: Optional[List[trw.transforms.Transform]] = None, nb_workers: int = 2, batch_size: int = 1, data_subsampling_fraction_train: float = 1.0, data_subsampling_fraction_valid: float = 1.0, train_split: str = 'train', valid_split: str = 'val', year: typing_extensions.Literal[2007, 2012] = '2007') → trw.basic_typing.Datasets

PASCAL VOC detection challenge

Attributes

OBJECT_CLASS_MAPPING

trw.datasets.voc._load_image_and_mask(batch, transform, normalize_0_1=True)
trw.datasets.voc._parse_voc_xml(node)

Extracted from torchvision

trw.datasets.voc.OBJECT_CLASS_MAPPING
trw.datasets.voc._load_image_and_bb(batch, transform, normalize_0_1=True)
trw.datasets.voc.default_voc_transforms()
trw.datasets.voc.create_voc_segmentation_dataset(batch_size: int = 40, root: Optional[str] = None, transform_train: Optional[List[trw.transforms.Transform]] = default_voc_transforms(), transform_valid: Optional[List[trw.transforms.Transform]] = None, nb_workers: int = 2, year: typing_extensions.Literal[2007, 2012] = '2012') trw.basic_typing.Datasets

Create the VOC segmentation dataset

Parameters
  • batch_size – the number of samples per batch

  • root – the root of the dataset

  • transform_train – the transform to apply on each batch of data of the training data

  • transform_valid – the transform to apply on each batch of data of the validation data

  • nb_workers – the number of worker process to pre-process the batches

  • year – the version of the dataset

Returns

a datasets with dataset voc2012 and splits train, valid.

trw.datasets.voc.create_voc_detection_dataset(root: str = None, transform_train: Optional[List[trw.transforms.Transform]] = None, transform_valid: Optional[List[trw.transforms.Transform]] = None, nb_workers: int = 2, batch_size: int = 1, data_subsampling_fraction_train: float = 1.0, data_subsampling_fraction_valid: float = 1.0, train_split: str = 'train', valid_split: str = 'val', year: typing_extensions.Literal[2007, 2012] = '2007') trw.basic_typing.Datasets

PASCAL VOC detection challenge

Notes

  • Batch size is always 1 since we need to sample from the image various anchors, locations depending on the task (so each sample should be post-processed by a custom transform)