-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix in BBox clipping #2310
Fix in BBox clipping #2310
Conversation
Reviewer's Guide by SourceryThis pull request addresses a bug in bounding box clipping where class IDs were being incorrectly modified when clipping was enabled. The fix ensures that bounding boxes are clipped to the image boundaries without altering the associated class labels or scores. Additionally, comprehensive tests have been added to cover various bounding box formats, edge cases, and data types. Sequence diagram for BBox clipping processsequenceDiagram
participant C as Client
participant BU as BBoxUtils
participant LF as LabelField
C->>BU: check_and_convert(bbox_data)
BU->>BU: convert_bbox_format()
BU->>BU: clip_bbox_coordinates()
Note over BU: Only clip x,y coordinates
Note over BU: Preserve class IDs/scores
BU->>BU: filter_invalid_bboxes()
BU-->>C: return processed_bboxes
Class diagram for BBox and Label Field handlingclassDiagram
class BBoxUtils {
+params
+check_and_convert(data)
-clip_bbox_coordinates()
-filter_invalid_bboxes()
}
class LabelFieldEncoder {
+is_numerical_label: dict
+label_encoders: dict
+_encode_label_field(data, data_name, label_field)
+_validate_label_field_length(data, data_name, label_field)
}
note for BBoxUtils "Modified clipping to preserve class IDs"
note for LabelFieldEncoder "Enhanced numerical type handling"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @ternaus - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2310 +/- ##
=========================================
+ Coverage 0 89.83% +89.83%
=========================================
Files 0 50 +50
Lines 0 9017 +9017
=========================================
+ Hits 0 8100 +8100
- Misses 0 917 +917
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Fixes: #2309
Summary by Sourcery
Bug Fixes: