Skip to content

Create RetinaNet object detection guide #2069

Merged
divyashreepathihalli merged 15 commits intokeras-team:masterfrom
sachinprasadhs:retinanet_guide
Apr 1, 2026
Merged

Create RetinaNet object detection guide #2069
divyashreepathihalli merged 15 commits intokeras-team:masterfrom
sachinprasadhs:retinanet_guide

Conversation

@sachinprasadhs
Copy link
Copy Markdown
Collaborator

@sachinprasadhs sachinprasadhs commented Mar 24, 2025

Summary:
This Pull Request introduces comprehensive documentation detailing how to use an object detection model from Keras Hub, using RetinaNet as an example.

This tutorial includes:

  • Loading and preprocessing a training dataset
  • Demonstrating inference using pretrained weights
  • Fine-tuning a pretrained object detector
  • Custom training of an object detector
  • Summary

Copy link
Copy Markdown
Collaborator

@divyashreepathihalli divyashreepathihalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @sachinprasadhs - since this is a guide - we should have more detailed explanations that would help users understand our framework better. Lets add more of that.

Thanks!

Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py
Copy link
Copy Markdown
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! All minor comments. Also heads up I added keras-team/keras-hub#2219 for coco id - name mappings. Whenever it is released we can use it.

Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py
@divyashreepathihalli
Copy link
Copy Markdown
Collaborator

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a guide for object detection with RetinaNet using Keras Hub. I have identified a critical issue in the data loading logic, along with suggestions to improve code quality and clarity.

Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/md/keras_hub/object_detection_retinanet.md Outdated
@sachinprasadhs
Copy link
Copy Markdown
Collaborator Author

@gemini-code-assist review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new tutorial for object detection using RetinaNet and KerasHub, covering data preparation, inference, and fine-tuning. The implementation includes notebook, script, and markdown versions. Reviewers identified several issues, most notably a bug in the metadata builder that caused data leakage by loading all annotations instead of split-specific ones. Other feedback included a pathing error in the VOC data loader, the use of global variables in preprocessing functions, and a recommendation to separate backup and checkpoint directories for better file management. All suggested improvements aim to enhance the correctness and modularity of the tutorial code.

Comment thread guides/ipynb/keras_hub/object_detection_retinanet.ipynb Outdated
Comment thread guides/ipynb/keras_hub/object_detection_retinanet.ipynb
Comment thread guides/keras_hub/object_detection_retinanet.py Outdated
Comment thread guides/ipynb/keras_hub/object_detection_retinanet.ipynb Outdated
Comment thread guides/ipynb/keras_hub/object_detection_retinanet.ipynb
@divyashreepathihalli divyashreepathihalli merged commit d3c2525 into keras-team:master Apr 1, 2026
3 checks passed
@sachinprasadhs sachinprasadhs deleted the retinanet_guide branch April 1, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants