keras-team / keras-cv

Industry-strength Computer Vision workflows with Keras
Other
1.01k stars 330 forks source link

Handling image dimensions for RetinaNet #1400

Open shilpakancharla opened 1 year ago

shilpakancharla commented 1 year ago

In order for RetinaNet to work, the image shape must be at least 512 by 512. Anything smaller than this, though divisible by 16, will not work. In the below Colab, I've tried out several different image shapes which have some dimension error regarding the image shape. I typically need to perform some kind of image augmentation in order to get the image shape to pass through the model.

It would be good to perhaps have an error message regarding this, telling users specifically how the image should be formatted.

Here are examples of the different kinds of errors I've run into, and the shapes I've tried to build the RetinaNet model with:

Screenshot 2023-02-15 at 2 44 10 PM Screenshot 2023-02-15 at 2 44 31 PM

Here's a link to the Colab where I built this model: https://colab.sandbox.google.com/drive/1iXZJ9GYb4cineDhaFV534Mjmi29TLLCg#scrollTo=02cA_lsyQjmz

LukeWood commented 1 year ago

Thanks for the bug report @shilpakancharla ! I'll add better error messages to the RetinaNet to remedy this issue.