keras-team / keras-cv

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

Port Faster R-CNN to Keras3 #2458

Closed sineeli closed 3 months ago

sineeli commented 5 months ago

What does this PR do?

Port legacy Faster R-CNN to Keras 3

Fix minor bug in ROI Align, make sure to build the shapes for each layer components.

The present PR is modified code of Updating FasterRCNN to use Task API contributed by @ariG23498. Please @ariG23498 any suggestions form your side are appreciated.

sineeli commented 5 months ago

Can we make last dimension of the roi_generator.py boxes output have fixed 4 as dimension, any suggestion on how to make it possible ?

Ref: image

sineeli commented 5 months ago

@VarunS1997 Review for any corrections are fixes required from based code.

Thanks!

ariG23498 commented 5 months ago

Hey @sineeli this is so cool! Thanks for taking this up. It was a long time ago and unfortunately I would not be able to give you a thorough review.

What I understand should be green flags are:

Last I worked on it I could not get every component to comply with the Functional API. If you got that part sorted, you are good to go ^_^

Closes #2012

sineeli commented 5 months ago

Hey @sineeli this is so cool! Thanks for taking this up. It was a long time ago and unfortunately I would not be able to give you a thorough review.

What I understand should be green flags are:

  • The model should follow the Functional API of Keras
  • It should use the model.fit() API and train on PASCAL VOC

Last I worked on it I could not get every component to comply with the Functional API. If you got that part sorted, you are good to go ^_^

Closes #2012

Yes trying to make it functional, hopefully it will workout!

sineeli commented 3 months ago

There are two implementations as per torch:

fasterrcnn_resnet50_fpn - Present Keras implementation similar to this config fasterrcnn_resnet50_fpn_v2 - Improved Configuration.

https://github.com/pytorch/vision/blob/8f73afacb81df1fcc6e2d308c5b734b126db3426/torchvision/models/detection/faster_rcnn.py#L470

divyashreepathihalli commented 3 months ago

@sineeli you will need to run shell/api_gen.sh, shell/format.sh and shell/lint.sh to resolve all the code format errors.

divyashreepathihalli commented 3 months ago

Excellent work!! Thanks Siva!!