Skip to content

fix: obb coordinate retrieval#430

Open
asabri97 wants to merge 10 commits intomainfrom
fix-obb-coordinate-retrieval-new
Open

fix: obb coordinate retrieval#430
asabri97 wants to merge 10 commits intomainfrom
fix-obb-coordinate-retrieval-new

Conversation

@asabri97
Copy link
Contributor

@asabri97 asabri97 commented Jan 11, 2026

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Fixes Oriented Bounding Box (OBB) coordinate retrieval so Flutter can correctly expose YOLOResult.obbPoints

📊 Key Changes

  • Adds classIndex to OBB result maps on Android (YOLOPlugin.kt) and iOS (YOLOInstanceManager.swift) for consistent metadata
  • Updates Flutter inference mapping to populate a polygon field from OBB points, enabling YOLOResult.obbPoints extraction
  • Improves robustness: handles empty OBB point lists and uses typed map conversion/safe getters for parsing
  • Extends YOLOResult with obbPoints, adds backward-compatible parsing (polygon or obbPoints), and includes polygon in toMap()
  • Bumps version to 0.1.47 and documents the fix in CHANGELOG.md
  • Adds tests covering mixed-type polygon parsing and toMap()/fromMap() round-trip

🎯 Purpose & Impact

  • Restores OBB polygon availability in Flutter results, enabling rotated box workflows (rendering, post-processing, export) 📐
  • Aligns iOS/Android OBB payloads and fixes incorrect/default classIndex handling 🧩
  • Increases stability when native payloads contain mixed types or missing/empty point data 🛡️

@asabri97 asabri97 linked an issue Jan 11, 2026 that may be closed by this pull request
1 task
@UltralyticsAssistant UltralyticsAssistant added bug Something isn't working fixed Bug has been resolved OBB Oriented Bounding Box (OBB) models labels Jan 11, 2026
@UltralyticsAssistant
Copy link
Member

👋 Hello @asabri97, thank you for submitting a ultralytics/yolo-flutter-app 🚀 PR! This is an automated message—an engineer will review and assist soon 🧰

-✅ 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.
-✅ Synchronize with Source: Confirm your PR is synchronized with the ultralytics/yolo-flutter-app main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
-✅ Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
-✅ Update Documentation: Update the relevant documentation for any new or modified features.
-✅ Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
-✅ Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
-✅ Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

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! 🚀

Copy link
Member

@UltralyticsAssistant UltralyticsAssistant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 PR Review

Made with ❤️ by Ultralytics Actions

Good, focused fix aligning Android/iOS OBB payloads and ensuring Flutter exposes OBB polygons via polygon/obbPoints, with solid test coverage. Two robustness gaps remain: (1) bounding box computation can still output infinities when points is present but invalid, and (2) obbPoints parsing should filter to points that include both x and y to avoid partially-formed coordinates.

💬 Posted 2 inline comments

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

❌ Patch coverage is 34.61538% with 17 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/core/yolo_inference.dart 0.00% 17 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@UltralyticsAssistant UltralyticsAssistant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 PR Review 2

Made with ❤️ by Ultralytics Actions

PR looks clean. The changes are consistent with the stated goal, and I didn’t find any new bugs or reliability issues in the modified lines.

Copy link

@cyberN80 cyberN80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @asabri97, looks great and I approve merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fixed Bug has been resolved OBB Oriented Bounding Box (OBB) models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to query OBB box coordinates?

3 participants