Add OBB angle to platform responses and fix usage example#461
Add OBB angle to platform responses and fix usage example#461yukihiratype2 wants to merge 2 commits intoultralytics:mainfrom
Conversation
|
All Contributors have signed the CLA. ✅ |
|
👋 Hello @yukihiratype2, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
The native angle plumbing and backward-compatible parsing look good overall, but the updated usage example still appears to document the raw platform payload instead of the normalized Dart API, so it would mislead users and likely fail as written.
💬 Posted 1 inline comment
|
|
||
| // Process oriented bounding boxes | ||
| final boxes = results['boxes'] as List<dynamic>; | ||
| final boxes = results['obb'] as List<dynamic>? ?? []; |
There was a problem hiding this comment.
yolo.predict() is normalized by YOLOInference.predict, which returns OBB results under results['detections'], not the raw platform key results['obb']. As written, this example still won't match the Flutter API shape users receive, and the subsequent field accessors (class vs className) will be out of sync as well.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
I have read the CLA Document and I sign the CLA
Summary
This PR adds OBB rotation angle support to native platform responses and updates the Flutter-side parsing so the angle is available in detections. It also fixes the OBB usage example in doc/usage.md so it reads the actual obb payload instead of the generic boxes result.
What changed
angleto OBB responses on iOS inYOLOInstanceManager.swiftangleto OBB responses on Android inYOLOPlugin.ktYOLOInferenceto:anglewhen presentangleDegreesand convert to radians when neededangleDegreesfallback conversiondoc/usage.mdto:results['obb']Validation
flutter test test/yolo_inference_test.dartNotes
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
This PR adds OBB angle data to Android and iOS platform responses, fixes the Flutter OBB usage example, and updates inference parsing with backward-compatible angle handling. 📦📐
📊 Key Changes
angleto OBB prediction responses inandroid/src/main/kotlin/com/ultralytics/yolo/YOLOPlugin.ktandios/Classes/YOLOInstanceManager.swift.lib/core/yolo_inference.dartto read OBB angles directly from platform output.angleDegreesvalues and converts them to radians for consistent downstream usage.doc/usage.mdto useresults['obb']instead ofresults['boxes'].angle, fallbackangleDegrees, and missing-angle default behavior intest/yolo_inference_test.dart.🎯 Purpose & Impact