aleju / imgaug

Image augmentation for machine learning experiments.
http://imgaug.readthedocs.io
MIT License
14.42k stars 2.44k forks source link

Feed batch of masks to geometric transform #798

Open jralves93 opened 3 years ago

jralves93 commented 3 years ago

Is it possible in imgaug to apply the transformation to a batch of masks too? As an example, I have the following code:

affine = iaa.geometric.Affine(scale=(0.8, 1.2), translate_percent=(0, 1), rotate=(0,360), shear=(-45,45), mode='wrap') affine(images=images, masks=masks)

Here, images is an array of images and masks is an array with the corresponding masks for segmentation. Now, I know we can use SegmentationMapsOnImage to apply masks to a single image. Is it possible to apply the transformation to a batch of images and a batch os corresponding masks as shown above or I need to create a segmentationmap for each single image individually?

Thank you