-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
More inplace #2048
More inplace #2048
Conversation
Reviewer's Guide by SourceryThis PR optimizes memory usage by modifying various numpy operations to perform calculations in-place where possible. The main changes involve adding the Class diagram for updated numpy operationsclassDiagram
class Functional {
+shift_hsv(img: np.ndarray, hue_shift: float, sat_shift: float, val_shift: float)
+evaluate_bez(t: np.ndarray, low_y: float | np.ndarray, high_y: float | np.ndarray)
+add_snow_bleach(img: np.ndarray, snow_point: float, brightness_coeff: float)
+add_fog()
+add_shadow(img: np.ndarray, vertices_list: list[np.ndarray], intensities: np.ndarray)
+iso_noise()
+fancy_pca(img: np.ndarray, alpha_vector: np.ndarray)
+unsharp_mask()
+add_noise(img: np.ndarray, noise: np.ndarray)
}
class GeometricFunctional {
+remap_keypoints()
+distort_image_keypoints()
+create_piecewise_affine_maps()
}
class DomainAdaptationFunctional {
+to_colorspace(self, img: np.ndarray)
+from_colorspace(self, img: np.ndarray)
+flatten(self, img: np.ndarray)
+reconstruct(self, pixels: np.ndarray, height: int, width: int)
}
class Transforms {
+get_params_dependent_on_data(self, params: dict[str, Any], data: dict[str, Any])
}
class BboxUtils {
+clip_bboxes(bboxes: np.ndarray, image_shape: tuple[int, int])
}
note for Functional "In-place operations added to shift_hsv, evaluate_bez, add_snow_bleach, add_fog, add_shadow, iso_noise, fancy_pca, unsharp_mask, add_noise"
note for GeometricFunctional "In-place operations added to remap_keypoints, distort_image_keypoints, create_piecewise_affine_maps"
note for DomainAdaptationFunctional "In-place operations added to from_colorspace, flatten, reconstruct"
note for Transforms "In-place operations added to get_params_dependent_on_data"
note for BboxUtils "In-place operations added to clip_bboxes"
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 using a more descriptive PR title like 'Optimize memory usage with in-place NumPy operations' to better reflect the changes
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 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 #2048 +/- ##
=========================================
+ Coverage 0 90.28% +90.28%
=========================================
Files 0 46 +46
Lines 0 7597 +7597
=========================================
+ Hits 0 6859 +6859
- Misses 0 738 +738 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Improve performance by using in-place operations in several functions and update albucore dependency version.
Enhancements:
Build: