feat: add option to preserve class ordering during model deployment#493
feat: add option to preserve class ordering during model deployment#493davidnichols-ops wants to merge 3 commits into
Conversation
Add DISABLE_CLASS_SORTING configuration option to prevent automatic alphabetical sorting of class names during YOLO model deployment. Users can set ROBOFLOW_DISABLE_CLASS_SORTING=true to maintain custom class ordering from model checkpoints. - Add DISABLE_CLASS_SORTING to config.py (defaults to false) - Update model_processor.py to conditionally apply sorting - Include warning comment about user responsibility for proper class ordering - Maintain backwards compatibility with default behavior Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add test suite for DISABLE_CLASS_SORTING configuration - Test default value, environment variable parsing, and case insensitivity - Update CHANGELOG.md with new feature entry Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Testing performed:✅ Config imports correctly with default value False Known limitations:
Usage example:export ROBOFLOW_DISABLE_CLASS_SORTING=true
python deploy_script.pyThis feature addresses the need to preserve custom class ordering in YOLO models during deployment, which is important for workflows where class indices have specific meaning or when models have been trained with non-standard class ordering. |
|
davidnichols-ops seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Summary
Add
DISABLE_CLASS_SORTINGconfiguration option to prevent automatic alphabetical sorting of class names during YOLO model deployment. Users can setROBOFLOW_DISABLE_CLASS_SORTING=trueto maintain custom class ordering from model checkpoints.Changes
DISABLE_CLASS_SORTINGtoconfig.py(defaults to false)model_processor.pyto conditionally apply sorting based on configurationUsage
export ROBOFLOW_DISABLE_CLASS_SORTING=true python your_deploy_script.pyTesting
FalseImpact
config.py,model_processor.py)Note
I used Devin (AI coding assistant) to help author this implementation, but I have verified the changes work correctly and follow the project's existing patterns and conventions.