Open thetoby9944 opened 3 years ago
Well, there is a workaround I've been using for a while, try to override the _mode_segmentation_maps property of your augmenter:
aug._mode_segmentation_maps = aug.mode.value
And in the case you have a composition of augmenters, such as Sequential, you can use the following:
for aug in augmenter.get_all_children():
try:
aug._mode_segmentation_maps = aug.mode.value
except AttributeError:
pass
Hope it helps.
I have the same problem and used the workaround.
Summary: Applying augmentations with SegmentationMapOnImage ignores the mode parameter. Any transformations that create a void image area (affine, pad, ...) is executed with constant border treatment only on the labels.
Example:
Observed Behavior: The image content gets reflected where the rotation would leave a void area - But the corresponding labels fill the void area black, instead of also reflecting the content. This creates a mismatch in image content and segmentation map content.
Expected Behavior: When the content of an image is reflected during rotation or padding, the corresponding segmentation map should be reflected as well. This also applies to other border treatment modes.