-
Notifications
You must be signed in to change notification settings - Fork 853
🔨 Replace imgaug with Native PyTorch Transforms
#2436
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
🔨 Replace imgaug with Native PyTorch Transforms
#2436
Conversation
- Introduced DRAEMAugmenter for advanced image augmentations using torchvision v2. - Implemented various augmentation techniques including ColorJitter, RandomAdjustSharpness, and custom transformations. - Added functionality for comparing augmentation methods and visualizing results. - Included utility functions for metrics computation and image processing. - Established logging for better traceability of operations. This commit enhances the image processing capabilities within the Anomalib framework, facilitating more robust anomaly detection workflows.
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/v2 #2436 +/- ##
=============================================
Coverage ? 78.28%
=============================================
Files ? 307
Lines ? 13115
Branches ? 0
=============================================
Hits ? 10267
Misses ? 2848
Partials ? 0 ☔ View full report in Codecov by Sentry. |
ashwinvaidya17
left a comment
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.
One minor comment
| amplitude *= persistence | ||
| return noise | ||
|
|
||
| def generate_perlin_noise( |
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.
Maybe for a different PR but it would be nice if we could remove inline methods.
| assert isinstance(validated_labels, np.ndarray) | ||
| assert validated_labels.dtype == bool | ||
| assert np.array_equal(validated_labels, np.array([False, True])) | ||
| assert np.array_equal(validated_labels, np.array([True, True])) |
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.
Is this correct?
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.
with numpy 2.0, yes
Signed-off-by: Samet Akcay <[email protected]>
djdameln
left a comment
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.
Did you confirm that the generated anomalous images look similar, visually, as the images generated with the previous approach?



📝 Description
imgaugdependency from project requirementsAugmenterclass with newPerlinAnomalyGeneratorusing torchvision transformsMultiRandomChoicetransform class for flexible augmentation pipelines✨ Changes
Select what type of change your PR is:
Examples
Before (using imgaug):
After (Using torch vision)
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.