Skip to content

Refactor model assets structure, for rfdetr 1.4.3+#6

Merged
Borda merged 5 commits intomainfrom
add/assets
Feb 16, 2026
Merged

Refactor model assets structure, for rfdetr 1.4.3+#6
Borda merged 5 commits intomainfrom
add/assets

Conversation

@Borda
Copy link
Member

@Borda Borda commented Feb 16, 2026

This pull request introduces a new asset management system for RF-DETR+ model weights, aligning with the updated asset structure in rf-detr version 1.4.3. The changes add a new ModelWeights enum for platform-licensed models, update dependencies, and deprecate the old download dictionary in favor of the new approach. These updates make it easier and more robust to reference and manage model weights in the codebase.

Asset management improvements:

  • Added a new ModelWeights enum in rfdetr_plus.assets.model_weights that inherits from ModelWeightsBase and provides structured access to platform-licensed model weights, including filenames, URLs, and MD5 hashes. This improves compatibility and maintainability for large-scale models.
  • Introduced the rfdetr_plus.assets module with an __init__.py that exposes ModelWeights for use throughout the codebase.

Dependency updates:

  • Updated the rfdetr dependency version in pyproject.toml to >=1.4.3,<2 to ensure compatibility with the new asset structure.

Backward compatibility and deprecation:

  • Deprecated the legacy PLATFORM_MODELS dictionary in rfdetr_plus/models/downloads.py, replacing it with a dynamically generated dictionary based on the new ModelWeights enum, while maintaining backward compatibility.

Copilot AI review requested due to automatic review settings February 16, 2026 16:00
@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94%. Comparing base (57ddaa8) to head (c331fbe).

Additional details and impacted files
@@        Coverage Diff         @@
##           main    #6   +/-   ##
==================================
+ Coverage    89%   94%   +5%     
==================================
  Files         4     6    +2     
  Lines        62    69    +7     
==================================
+ Hits         55    65   +10     
+ Misses        7     4    -3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors RF-DETR+’s model-weight asset handling to align with the rfdetr >=1.4.3 asset structure, introducing a structured registry while keeping the legacy download mapping available for compatibility.

Changes:

  • Added rfdetr_plus.assets.ModelWeights (backed by rfdetr.assets.model_weights) to centrally define filenames, URLs, and MD5 hashes for platform-licensed weights.
  • Deprecated the legacy PLATFORM_MODELS mapping by generating it from ModelWeights to preserve backward compatibility.
  • Bumped the rfdetr dependency requirement to >=1.4.3,<2.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/rfdetr_plus/models/downloads.py Replaces hard-coded legacy mapping with a derived dictionary from ModelWeights (keeps compatibility).
src/rfdetr_plus/assets/model_weights.py Introduces the new ModelWeights registry enum with filename/url/md5 metadata.
src/rfdetr_plus/assets/__init__.py Exposes ModelWeights as the public entry point for the assets module.
pyproject.toml Updates rfdetr minimum version to ensure upstream asset APIs are available.

@Borda Borda added the enhancement New feature or request label Feb 16, 2026
@Borda Borda merged commit f124941 into main Feb 16, 2026
12 checks passed
@Borda Borda deleted the add/assets branch February 16, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments