-
-
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 box filtering #2001
Fix box filtering #2001
Conversation
Reviewer's Guide by SourceryThis pull request addresses an issue with box filtering in the Albumentations library. The changes primarily focus on refactoring the postprocessing logic in the core utils, improving the handling of empty keypoints, and enhancing the RandomResizedCrop transform. The modifications aim to fix a reported issue and improve the overall robustness of the library. Updated class diagram for postprocessing logicclassDiagram
class Postprocessor {
+postprocess(data: dict[str, Any]) dict[str, Any]
+_process_data_fields(data: dict[str, Any], image_shape: tuple[int, int]) dict[str, Any]
+_process_single_field(data_name: str, field_data: Any, image_shape: tuple[int, int]) Any
+_create_empty_keypoints_array() np.ndarray
+_convert_sequence_inputs(data: dict[str, Any]) dict[str, Any]
}
note for Postprocessor "Refactored to improve handling of empty keypoints and sequence inputs"
Updated class diagram for RandomResizedCropclassDiagram
class RandomResizedCrop {
+InitSchema
}
class InitSchema {
+scale: Annotated[tuple[float, float], AfterValidator(check_01), AfterValidator(nondecreasing)]
+ratio: Annotated[tuple[float, float], AfterValidator(check_0plus), AfterValidator(nondecreasing)]
+width: int | None
}
note for InitSchema "Enhanced with nondecreasing validator for scale and ratio"
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 - here's some feedback:
Overall Comments:
- Consider adding a note in the documentation about the changes to the InitSchema class, particularly the addition of the nondecreasing validator for 'scale' and 'ratio' parameters. This will help users understand the new constraints and potential impacts on existing code.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 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.
Fixes: #1999
Summary by Sourcery
Fix box filtering logic and enhance the RandomResizedCrop transformation with additional validators. Add a test to verify the correct handling of bounding boxes and labels in the RandomResizedCrop transformation.
Bug Fixes:
Enhancements:
Tests: