Fix visual prompt training for YOLOE26#23401
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Test demo @Laughing-q |
|
👋 Hello @ShuaiLYU, thank you for submitting a -✅ Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions. For more guidance, please refer to our Contributing Guide. This is an automated message, and an Ultralytics engineer will assist shortly. 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Looks clean. The changes are straightforward and align with the intended behavior; no issues found.
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Jing Qiu <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Laughing-q <1185102784@qq.com>
Fix Visual Prompt Training and Typo in YOLOE26
Summary
This PR fixes visual prompt training issues YOLOE/YOLOE26 models.
Changes
1. Add
tal_topk2parameter support to TVPDetectLosstal_topk2parameter toTVPDetectLoss.__init__()for flexible task-aligned assignment configurationtal_topk2through to the underlyingv8DetectionLossfor better one-to-one assignment control_get_vp_featuresto use the full score tensor2. Fix typo in YOLOEDetect forward_lrpc
self.one2one_cv2toself.one2one_cv3in theforward_lrpcmethod🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Fixes visual-prompt training behavior for YOLOe26 by correcting an end-to-end head routing bug and aligning TVP loss feature/parameter handling. 🛠️
📊 Key Changes
forward_lrpc()to useone2one_cv3(notone2one_cv2) for classification features in end-to-end mode.TVPDetectLossto accept and forward an optionaltal_topk2parameter intov8DetectionLoss.preds["scores"]instead of slicing byori_nc, preventing unintended channel dropping.🎯 Purpose & Impact
tal_topk2, helping advanced training setups behave as expected. ⚙️