Skip to content

Register HGNetV2 presets #2326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

laxmareddyp
Copy link
Collaborator

@laxmareddyp laxmareddyp commented Jul 12, 2025

Description of the change

Reference

Colab Notebook

Checklist

  • I have added all the necessary unit tests for my change.
  • I have verified that my change does not break existing code and works with all backends (TensorFlow, JAX, and PyTorch).
  • My PR is based on the latest changes of the main branch (if unsure, rebase the code).
  • I have followed the Keras Hub Model contribution guidelines in making these changes.
  • I have followed the Keras Hub API design guidelines in making these changes.
  • I have signed the Contributor License Agreement.

Copy link

@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.

Summary of Changes

Hello @laxmareddyp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates the HGNetV2 model presets into the Keras Hub framework by enabling their automatic registration and providing direct links to their pre-trained weights on Kaggle. This change enhances the usability and discoverability of the HGNetV2 models within the Keras ecosystem.

Highlights

  • Model Preset Registration: I have added a new __init__.py file within the hgnetv2 model directory to automatically register the HGNetV2Backbone model with its predefined presets upon package import. This ensures that the model and its configurations are discoverable within the Keras Hub system.
  • Kaggle Handle Updates for HGNetV2 Presets: I have updated the hgnetv2_presets.py file to populate the kaggle_handle field for several HGNetV2 model variants (b4, b5, and b6, including both stage1 and stage2 fine-tuned versions). These updates link the presets to their respective pre-trained model assets hosted on Kaggle, making them directly accessible for users.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@laxmareddyp laxmareddyp added the kokoro:force-run Runs Tests on GPU label Jul 12, 2025
Copy link

@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 registers presets for the HGNetV2 model, enabling them to be loaded using from_preset(). The changes are straightforward and appear correct. A new __init__.py file is added to handle the registration, and the hgnetv2_presets.py file is updated with the appropriate Kaggle Hub handles.

I've reviewed the changes and they look good. The implementation is consistent with the existing patterns in the repository for model preset registration, and I did not find any issues of medium or higher severity.

As a minor process note, the pull request description is currently empty. It would be beneficial to add a brief summary of the changes and fill out the checklist before merging.

@kokoro-team kokoro-team removed the kokoro:force-run Runs Tests on GPU label Jul 12, 2025
@divyashreepathihalli divyashreepathihalli merged commit 6729eaf into keras-team:master Jul 15, 2025
17 checks passed
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