-
Notifications
You must be signed in to change notification settings - Fork 694
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
🔨 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 <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
Signed-off-by: Samet Akcay <samet.akcay@intel.com>
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. |
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
|
||
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.
@@ -185,7 +185,7 @@ def test_validate_gt_label_valid_string_input(self) -> None: | |||
validated_labels = self.validator.validate_gt_label(["0", "1"]) | |||
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 <samet.akcay@intel.com>
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
imgaug
dependency from project requirementsAugmenter
class with newPerlinAnomalyGenerator
using torchvision transformsMultiRandomChoice
transform 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.