Open vojavocni opened 5 years ago
UPDATE: It seems the masks are not automatically cast to SegmentationMapOnImage. This means I have to do it manually prior to creating ia.Batch. Is this really necessary? I would find it very convenient to do it under the hood, after all we are explicetely defining them to be segmentation mapsas soon as we insert them in a parameter called segmentation_maps, right?
Yes, imgaug currently only allows images to be arrays and everything else has to be objects. Batch
and augment_batches()
are the only places where that could be changed. I guess the main reason so far to not do that was simply lack of time to implement it.
There is some minor risk though that people call the class/method via positional arguments, then mess up the order of these arguments and get completely wrong results that are hard to debug. Not sure how many people use positional arguments in such cases.
The latest version in master should now support this since PR #290, e.g. via
batch = ia.UnnormalizedBatch(images=<array>, segmentation_maps=<(N, H, W) array>)
batch_aug = seq.augment_batch(batch)
or
images_aug, segmaps_aug = seq.augment(images=<array>, segmentation_maps<(N, H, W) array>)
Say I have a list of 10 images X and corresponding 10 masks y. I do the following:
I get the following error:
Not sure what happens here, I think I followed everything I found in the documentation. X is a list of images of size 256x256x3, and y is 256x256x1. Could be a bug. I will also dig a bit more through the code if I have time.