How to deal with bboxes in preprocess/augmentation layer


I want to compare the speed between augmenting images using and having the augmentation done in a preprocessing layer.
Using .map I can get to the bboxes to perform the augmentation on them also since I’m mapping the whole dataset, images, bboxes and more.
But how can I perform the augmentation on the bboxes when I’m using the preprocessing layer? Is it possible to get to the bboxes here also or does only the images go through here?


I am facing the same problem. I’m trying to pull the dog parts of the images in “Stanford Dogs” and it has become clear that I need to make a variant of the Keras Resizing layer that receives two inputs (image, bbox) and does “crop and resize”.

If all goes well I will post it as my first PR.

We will start to collect something at: