When applying a rotation with symmetric mode (i.e. padding mode) the segmentation map is not mirrored accordingly. The rotation of the map is fine, just its padding is missing.
Reproduction
I modified one of your examples to demonstrate the problem:
import numpy as np
import imgaug as ia
import imgaug.augmenters as iaa
from imgaug.augmentables.segmaps import SegmentationMapsOnImage
import matplotlib.pyplot as plt
# Load an example image (uint8, 128x128x3).
image = ia.quokka(size=(128, 128), extract="square")
# Define an example segmentation map (int32, 128x128).
# Here, we arbitrarily place some squares on the image.
# Class 0 is our intended background class.
segmap = np.zeros((128, 128, 1), dtype=np.int32)
segmap[28:71, 35:85, 0] = 1
segmap[10:25, 30:45, 0] = 2
segmap[10:25, 70:85, 0] = 3
segmap[10:110, 5:10, 0] = 4
segmap[118:123, 10:110, 0] = 5
segmap = SegmentationMapsOnImage(segmap, shape=image.shape)
# Define our augmentation pipeline.
seq = iaa.Sequential([
iaa.Affine(rotate=-45, mode="symmetric"), # if we don't use mode="symmetric", the final result is correct.
])
image_aug, segmaps_aug = seq(image=image, segmentation_maps=segmap)
overlay = segmaps_aug.draw_on_image(image_aug)[0]
plt.imshow(overlay)
plt.show()
When applying a rotation with symmetric mode (i.e. padding mode) the segmentation map is not mirrored accordingly. The rotation of the map is fine, just its padding is missing.
Reproduction I modified one of your examples to demonstrate the problem:
Result
Expected result