Skip to content

Geometric augmentations should happen before cropping in topdown pipelines #76

Closed

Description

Currently, we are applying geometric augmentations (e.g., rotation) after doing the instance crops:

if use_augmentations and "intensity" in self.data_config.augmentation_config:
datapipe = KorniaAugmenter(
datapipe,
**dict(self.data_config.augmentation_config.intensity),
image_key="image",
instance_key="instances",
)
datapipe = InstanceCentroidFinder(
datapipe, anchor_ind=self.confmap_head.anchor_part
)
datapipe = InstanceCropper(
datapipe,
self.data_config.preprocessing.crop_hw,
)
if use_augmentations and "geometric" in self.data_config.augmentation_config:
datapipe = KorniaAugmenter(
datapipe,
**dict(self.data_config.augmentation_config.geometric),
image_key="instance_image",
instance_key="instance",
)

This should happen before cropping so we don't get black borders in the augmented images.

Intensity augmentation can happen after cropping, but we might as well do it all in one step (before).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions