fix: correct ONNX export output names for segmentation models#508
fix: correct ONNX export output names for segmentation models#508lixiaolei1982 wants to merge 4 commits intoroboflow:developfrom
Conversation
- Modified export() method in rfdetr/main.py - Added dynamic output name configuration - Segmentation models now include 'masks' output - Backward compatible with detection and backbone models
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where segmentation models were not correctly configured with three output names during ONNX export. The fix adds dynamic output name configuration based on model type, ensuring that segmentation models include the 'masks' output while maintaining backward compatibility with detection and backbone-only models.
Changes:
- Modified the
export()method to use conditional logic for output name configuration - Added support for segmentation models to include 'masks' in the output names list
- Maintained backward compatibility for backbone-only and detection models
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@lixiaolei1982, I like your fix; however, could you please provide sample code or ideally add a test to prove it works now as expected? |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0%) is below the target coverage (95%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #508 +/- ##
======================================
- Coverage 17% 17% -0%
======================================
Files 42 42
Lines 5578 5582 +4
======================================
Hits 925 925
- Misses 4653 4657 +4 🚀 New features to boost your workflow:
|
|
When will you approve ? |
Just when we have added a test to prove that it really fixes the issue 🚀 |
Description
Fix an inconsistency in the ONNX export function where segmentation models were not correctly configured with three output names.
Issue
When exporting segmentation models to ONNX format, the third output (
masks) is not properly named in the output specification, which could lead to:Changes Made
export()methodself.args.segmentation_head['features']['dets', 'labels', 'masks']['dets', 'labels']Type of change