-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/ultralytics obb support #4230
Feat/ultralytics obb support #4230
Conversation
- Add YoloOBB class adapter - Use obb attribute from OBB ultralytics model outputs to create 51 polyline label.
WalkthroughThe recent update introduces functionality to handle Oriented Bounding Box (OBB) models from Ultralytics YOLO within the FiftyOne toolkit. It adds a specific function for converting YOLO instance segmentations to the FiftyOne format, alongside new classes designed for managing YOLO OBB detection models. Additionally, it updates the conversion logic to support these OBB models, enhancing the toolkit's versatility in object detection tasks. Changes
Possibly related issues
Poem
Warning Following problems were encountered
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Status
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- fiftyone/utils/ultralytics.py (4 hunks)
Additional comments not posted (4)
fiftyone/utils/ultralytics.py (4)
45-48
: Consider adding a brief docstring to the_convert_yolo_obb_model
function to explain its purpose and usage.
172-222
: Ensure that theobb_to_polylines
function correctly handles the conversion of OBB detections to polylines, especially the transformation of coordinates from the OBB format to the polyline format. Verify that thepoints
variable is correctly populated with the expected format for polylines in FiftyOne.#!/bin/bash # Verify the coordinate transformation logic by checking for unit tests or examples that use `obb_to_polylines`. fd --type f --exec grep -Hn 'obb_to_polylines' {} +
440-458
: Ensure that theFiftyOneYOLOOBBModel
class's_format_predictions
method correctly converts predictions to the expected format for FiftyOne. This is crucial for integrating OBB detections into the FiftyOne ecosystem seamlessly.#!/bin/bash # Check for usage examples or tests for `FiftyOneYOLOOBBModel` to ensure correct prediction formatting. fd --type f --exec grep -Hn 'FiftyOneYOLOOBBModel' {} +
505-507
: The_convert_yolo_obb_model
function correctly creates a configuration for the OBB model and returns an instance ofFiftyOneYOLOOBBModel
. Ensure that this function is properly integrated and used wherever Ultralytics YOLO OBB models need to be converted for use in FiftyOne.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this implementation looks solid to me, and it works! Noting that the OBB models from Ultralytics are trained on DOTA so don't really work on datasets like COCO :)
Awesome contribution @dimidagd 💪
If you're so inclined, also feel free to add these pretrained OBB models to the FiftyOne Model Zoo, so that downloading and location of checkpoint is managed by FiftyOne :) You can do so by adding them here. In addition, you can add a section to the Ultralytics integration docs inference section for OBB object detection.
All that being said, if you don't have the time, we can also make sure these get in, so as to highlight the awesomeness of your work!!!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4230 +/- ##
========================================
Coverage 28.23% 28.23%
========================================
Files 813 813
Lines 101849 101849
Branches 1214 1214
========================================
Hits 28761 28761
Misses 73088 73088
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
What changes are proposed in this pull request?
Model outputs from OBB ultralytics models were ignored. This commit enables use of apply_model method on a 51 dataset.
(Details)
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
notes for FiftyOne users.
(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit