Skip to content

Add HGNetV2 to KerasHub #2293

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

harshaljanjani
Copy link
Collaborator

Description of the Change

It is an end-to-end image classification model which had to be implemented on KerasHub as a building block towards supporting D-FINE. A number of D-FINE's presets depend on derivatives of the HGNetV2Backbone, and this model sets any required infrastructure in place to serve them. Its addition unlocks and allows follow-on integration effort toward D-FINE on KerasHub. Concurrently, I am working on exploring the integration paradigm for D-FINE with HGNetV2 layers.

Closes the first half of #2271

Reference

Please read Page 15/18, Section A.1.1 of the D-FINE paper, and the HF config files to verify this point. The "backbone": null argument in the HuggingFace configuration translates to an HGNetV2 backbone.

Colab Notebook

Usage and Numerics Matching Colab

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.

@harshaljanjani harshaljanjani self-assigned this Jun 9, 2025
@harshaljanjani
Copy link
Collaborator Author

A few nits might come up as I start using the HGNetV2Backbone within the D-FINE implementation, but for now, it looks solid, complete, and congruous with KH's integration expectations. You are welcome to take a look. I'll be keeping it as a draft PR until I get DFineBackbone integrated.
As for D-FINE, the layers are ready, and the backbone and task model are standalone written in Keras. What's left is to integrate them into the infra.

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.

1 participant