Transforms

packnet_sfm.datasets.transforms.get_transforms(mode, image_shape, jittering, **kwargs)[source]

Get data augmentation transformations for each split

Parameters
  • mode (str {'train', 'validation', 'test'}) – Mode from which we want the data augmentation transformations

  • image_shape (tuple (height, width)) – Image dimension to reshape

  • jittering (tuple (brightness, contrast, saturation, hue)) – Color jittering parameters

Returns

XXX_transform – Data augmentation transformation for that mode

Return type

Partial function

packnet_sfm.datasets.transforms.test_transforms(sample, image_shape)[source]

Test data augmentation transformations

Parameters
  • sample (dict) – Sample to be augmented

  • image_shape (tuple (height, width)) – Image dimension to reshape

Returns

sample – Augmented sample

Return type

dict

packnet_sfm.datasets.transforms.train_transforms(sample, image_shape, jittering)[source]

Training data augmentation transformations

Parameters
  • sample (dict) – Sample to be augmented

  • image_shape (tuple (height, width)) – Image dimension to reshape

  • jittering (tuple (brightness, contrast, saturation, hue)) – Color jittering parameters

Returns

sample – Augmented sample

Return type

dict

packnet_sfm.datasets.transforms.validation_transforms(sample, image_shape)[source]

Validation data augmentation transformations

Parameters
  • sample (dict) – Sample to be augmented

  • image_shape (tuple (height, width)) – Image dimension to reshape

Returns

sample – Augmented sample

Return type

dict