-
-
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 #2286
Fix #2286
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new implementation for remapping bounding boxes using masks. It also includes new tests for the mask to bounding box conversion and fixes a bug in the camera and fisheye distortion transforms. Sequence diagram for the new bounding box remapping processsequenceDiagram
participant C as Client
participant R as Remapper
participant M as MaskConverter
C->>R: remap_bboxes(bboxes, map_x, map_y)
R->>M: bboxes_to_mask(bboxes)
Note right of M: Convert bboxes to multi-channel mask
M-->>R: bbox_masks
R->>R: remap(bbox_masks)
Note right of R: Apply displacement maps
R->>M: mask_to_bboxes(transformed_masks)
Note right of M: Convert masks back to bboxes
M-->>R: new_bboxes
R-->>C: transformed bboxes
Class diagram for the updated bbox utilsclassDiagram
class BBoxUtils {
+bboxes_to_mask(bboxes: ndarray, image_shape: tuple) ndarray
+mask_to_bboxes(masks: ndarray, original_bboxes: ndarray) ndarray
+masks_from_bboxes(bboxes: ndarray, shape: tuple) ndarray
}
note for BBoxUtils "New mask-based bbox transformation methods"
class GeometricFunctional {
+remap_bboxes(bboxes: ndarray, map_x: ndarray, map_y: ndarray, image_shape: tuple) ndarray
+get_camera_matrix_distortion_maps(image_shape: tuple, k: float) tuple
+get_fisheye_distortion_maps(image_shape: tuple, k: float) tuple
}
note for GeometricFunctional "Simplified distortion methods"
Flow diagram for bbox remapping processflowchart TD
A[Input Bboxes] --> B[Convert to Mask]
B --> C[Apply Displacement Maps]
C --> D[Convert Back to Bboxes]
D --> E[Output Transformed Bboxes]
subgraph Mask Processing
B
C
D
end
note[New mask-based approach replaces<br>the old point-sampling method]
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: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2286 +/- ##
=========================================
+ Coverage 0 89.87% +89.87%
=========================================
Files 0 50 +50
Lines 0 8838 +8838
=========================================
+ Hits 0 7943 +7943
- Misses 0 895 +895
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Fixes: #2285
Summary by Sourcery
Fix keypoint remapping and bounding box remapping logic, and update Codespell.
Bug Fixes:
Tests: