feat: infer num_classes from COCO annotations - #1111
Merged
Conversation
Contributor
🤖 Multi-Model Consensus Review
✅
|
Contributor
|
✅ Skylos Scan: No dead code or security issues detected. |
COCO uses 80 classes with IDs 1-90 (with gaps like 12, 26, 29-30, etc.). The previous validation incorrectly rejected these non-contiguous IDs. Changes: - Remove contiguous category ID validation that broke COCO support - Simplify class_names building to enumerate sorted IDs sequentially - Models use internal indices 0 to N-1 mapped from sorted category IDs - Update test to verify non-contiguous IDs are handled correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
🤖 Multi-Model Consensus Review
✅
|
Contributor
|
✅ Skylos Scan: No dead code or security issues detected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
num_classesfrom COCOcategoriesinann_file/val_ann_file(or explicit overrides) instead of requiring it in model YAML presets.num_classesfrom shipped model presets and add regression tests for override precedence, metainfo fallback, and single-stage heads.