-
Notifications
You must be signed in to change notification settings - Fork 830
π feat(dataset): add 3D-ADAM dataset to Anomalib #2986
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
π feat(dataset): add 3D-ADAM dataset to Anomalib #2986
Conversation
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.
Thanks for the contribution! I still need to check it manually but I have a few minor comments.
Can you also add a test for this?
These might help
https://github.com/open-edge-platform/anomalib/tree/main/tests/unit/data/datamodule/image
anomalib/tests/helpers/data.py
Line 263 in f95cdf9
class DummyImageDatasetGenerator(DummyDatasetGenerator): |
If not, I can create a follow-up PR for the tests.
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.
Thanks for the contribution. I left some comments.
It also looks like you need to update the imports at src/anomalib/data/__init__.py
Thank you for the feedback, I have enabled pre-commit hooks and resolved the given comments, much appreciated. |
β¦l dependencies (open-edge-platform#2956) * fix(data): enable pin_memory for DataLoader instances across the codebase This commit updates various DataLoader instances in the project to enable the option, enhancing performance for data loading on GPU. Changes were made in the following files: - : Updated train and test DataLoader configurations. - : Modified datamodule DataLoader to include . - : Added to evaluation DataLoader. - : Updated DataLoader for datasets to utilize . - : Enabled for reference dataset DataLoader. - : Adjusted inference DataLoader to include . These changes aim to optimize memory usage and improve data transfer speeds during model training and inference. Signed-off-by: samet-akcay <samet.akcay@intel.com> * refactor(models): streamline decoder retrieval in function This commit refactors the function in to utilize a dictionary mapping for decoder architectures, improving readability and maintainability. The previous conditional checks have been replaced with a more efficient approach, enhancing the overall structure of the code. Signed-off-by: samet-akcay <samet.akcay@intel.com> * fix(model): update logit_scale initialization to use torch.log for consistency This commit modifies the initialization of the logit_scale parameter in the CLIP model to utilize torch.log instead of np.log. This change ensures consistency in tensor operations and improves compatibility with PyTorch's computation graph. Signed-off-by: samet-akcay <samet.akcay@intel.com> * fix(model): update anomaly map generation to use torch tensors for calculations This commit modifies the anomaly map generation logic to utilize PyTorch tensors instead of NumPy arrays for various calculations. This change enhances compatibility with the PyTorch computation graph and improves performance by leveraging GPU acceleration. Key updates include the conversion of statistical calculations and tensor operations to use PyTorch functions, ensuring consistency in tensor handling throughout the code. Signed-off-by: samet-akcay <samet.akcay@intel.com> * refactor(model): enhance anomaly map generation with PyTorch for statistical calculations This commit refactors the anomaly map generation logic to replace NumPy-based statistical calculations with PyTorch equivalents, specifically using the distribution for computing tau. Additionally, it improves precision handling by allowing the use of float64 in high precision mode. The changes streamline the computation process and maintain compatibility with the PyTorch computation graph. Signed-off-by: samet-akcay <samet.akcay@intel.com> * chore(license): update license year Signed-off-by: samet-akcay <samet.akcay@intel.com> * fix(download): enhance URL validation and update download logic This commit improves the URL validation in the download function to ensure only http and https schemes are allowed. Additionally, it adds comments to clarify the safety of using under these conditions, enhancing code readability and security awareness. Signed-off-by: samet-akcay <samet.akcay@intel.com> * ποΈ chore(imports): remove OptionalImport class for optional dependency handling Signed-off-by: samet-akcay <samet.akcay@intel.com> * π fix(imports): Replace OptionalImport with dummy classes for missing dependencies This commit removes the OptionalImport class and introduces dummy classes for various loggers and video utilities when their respective dependencies are not installed. The changes enhance error messaging by providing clear instructions for installation, improving user experience when encountering missing packages. Affected files: - video.py - comet.py - mlflow.py - tensorboard.py - wandb.py - ollama.py Signed-off-by: samet-akcay <samet.akcay@intel.com> --------- Signed-off-by: samet-akcay <samet.akcay@intel.com> Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
ignore uv.lock in semgrep Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com> Signed-off-by: Paul McHard <paulmchard@gmail.com>
β¦ itself will not be modified (open-edge-platform#2966) fix in dryrun_find_featuremap_dims: run the model in eval() so the weights of the model itself will not be modified Signed-off-by: Paul McHard <paulmchard@gmail.com>
β¦#2979) π fix(ovinferencer): update cache folder name to 'openvino_cache' and ensure string path for set_property Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Please advise if there's any changes required to correct for the unit test which is timing out. |
Signed-off-by: Paul McHard <paulmchard@gmail.com>
I was testing this locally, the download file link is still not the correct one I guess. |
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Signed-off-by: Paul McHard <paulmchard@gmail.com>
All outstanding issues should now be resolved. Please let me know if there's anything else needing addressed. |
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.
Thanks for the update, two questions.
- Why are the file permissions changed?
- Why is the uv lock file updated? I can see that almost all lines have been removed.
Signed-off-by: Paul McHard <paulmchard@gmail.com>
Unsure as to why uv lock file or file permissions appear updated, no change on my end to code should have causes this, and appears normal in local and on fork. Hopefully addressed these issues and remaining comments in most recent commit. |
Signed-off-by: Paul McHard <32065439+PaulMcHard@users.noreply.github.com>
uv.lock issue appeared to be coming from an issue with git lfs on my end locally, appears to be resolved now let me know if there's any other changes required. |
1c99f8b
into
open-edge-platform:feature/dataset/3dadam
* π feat(dataset): add 3D-ADAM dataset to Anomalib (#2986) * π fix(utils): revert `OptionalImport` class to handle missing optional dependencies (#2956) * fix(data): enable pin_memory for DataLoader instances across the codebase This commit updates various DataLoader instances in the project to enable the option, enhancing performance for data loading on GPU. Changes were made in the following files: - : Updated train and test DataLoader configurations. - : Modified datamodule DataLoader to include . - : Added to evaluation DataLoader. - : Updated DataLoader for datasets to utilize . - : Enabled for reference dataset DataLoader. - : Adjusted inference DataLoader to include . These changes aim to optimize memory usage and improve data transfer speeds during model training and inference. Signed-off-by: samet-akcay <samet.akcay@intel.com> * refactor(models): streamline decoder retrieval in function This commit refactors the function in to utilize a dictionary mapping for decoder architectures, improving readability and maintainability. The previous conditional checks have been replaced with a more efficient approach, enhancing the overall structure of the code. Signed-off-by: samet-akcay <samet.akcay@intel.com> * fix(model): update logit_scale initialization to use torch.log for consistency This commit modifies the initialization of the logit_scale parameter in the CLIP model to utilize torch.log instead of np.log. This change ensures consistency in tensor operations and improves compatibility with PyTorch's computation graph. Signed-off-by: samet-akcay <samet.akcay@intel.com> * fix(model): update anomaly map generation to use torch tensors for calculations This commit modifies the anomaly map generation logic to utilize PyTorch tensors instead of NumPy arrays for various calculations. This change enhances compatibility with the PyTorch computation graph and improves performance by leveraging GPU acceleration. Key updates include the conversion of statistical calculations and tensor operations to use PyTorch functions, ensuring consistency in tensor handling throughout the code. Signed-off-by: samet-akcay <samet.akcay@intel.com> * refactor(model): enhance anomaly map generation with PyTorch for statistical calculations This commit refactors the anomaly map generation logic to replace NumPy-based statistical calculations with PyTorch equivalents, specifically using the distribution for computing tau. Additionally, it improves precision handling by allowing the use of float64 in high precision mode. The changes streamline the computation process and maintain compatibility with the PyTorch computation graph. Signed-off-by: samet-akcay <samet.akcay@intel.com> * chore(license): update license year Signed-off-by: samet-akcay <samet.akcay@intel.com> * fix(download): enhance URL validation and update download logic This commit improves the URL validation in the download function to ensure only http and https schemes are allowed. Additionally, it adds comments to clarify the safety of using under these conditions, enhancing code readability and security awareness. Signed-off-by: samet-akcay <samet.akcay@intel.com> * ποΈ chore(imports): remove OptionalImport class for optional dependency handling Signed-off-by: samet-akcay <samet.akcay@intel.com> * π fix(imports): Replace OptionalImport with dummy classes for missing dependencies This commit removes the OptionalImport class and introduces dummy classes for various loggers and video utilities when their respective dependencies are not installed. The changes enhance error messaging by providing clear instructions for installation, improving user experience when encountering missing packages. Affected files: - video.py - comet.py - mlflow.py - tensorboard.py - wandb.py - ollama.py Signed-off-by: samet-akcay <samet.akcay@intel.com> --------- Signed-off-by: samet-akcay <samet.akcay@intel.com> Signed-off-by: Paul McHard <paulmchard@gmail.com> * Added 3D-ADAM Dataset Signed-off-by: Paul McHard <paulmchard@gmail.com> * Added tests and example config Signed-off-by: Paul McHard <paulmchard@gmail.com> * π¨ fix(semgrep): ignore uv.lock in semgrep (#2972) ignore uv.lock in semgrep Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com> Signed-off-by: Paul McHard <paulmchard@gmail.com> * π fix(utils): Run CS Flow model in eval() so the weights of the model itself will not be modified (#2966) fix in dryrun_find_featuremap_dims: run the model in eval() so the weights of the model itself will not be modified Signed-off-by: Paul McHard <paulmchard@gmail.com> * π fix(ovinferencer): Fix openvino cache directory (#2979) π fix(ovinferencer): update cache folder name to 'openvino_cache' and ensure string path for set_property Signed-off-by: Paul McHard <paulmchard@gmail.com> * changes per PR and pre-commit checks Signed-off-by: Paul McHard <paulmchard@gmail.com> * resolve circular import issue Signed-off-by: Paul McHard <paulmchard@gmail.com> * Resolve DownloadInfo URL issue. Signed-off-by: Paul McHard <paulmchard@gmail.com> * Resolve DownloadInfo URL Signed-off-by: Paul McHard <paulmchard@gmail.com> * restore doc images ignored in error Signed-off-by: Paul McHard <paulmchard@gmail.com> * Removed prettier cache included in error, re-run pre-commit hooks Signed-off-by: Paul McHard <paulmchard@gmail.com> * explictly resolve EOF error on docs/source/examples Signed-off-by: Paul McHard <paulmchard@gmail.com> * resolve filename issue in adam3d test. Signed-off-by: Paul McHard <paulmchard@gmail.com> * Restore uv.lock Signed-off-by: Paul McHard <32065439+PaulMcHard@users.noreply.github.com> --------- Signed-off-by: samet-akcay <samet.akcay@intel.com> Signed-off-by: Paul McHard <paulmchard@gmail.com> Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com> Signed-off-by: Paul McHard <32065439+PaulMcHard@users.noreply.github.com> Co-authored-by: Samet Akcay <samet.akcay@intel.com> Co-authored-by: Ashwin Vaidya <ashwin.vaidya@intel.com> Co-authored-by: Rune <60315601+monzelr@users.noreply.github.com> Co-authored-by: Rajesh Gangireddy <rajesh.gangireddy@intel.com> * revert changes to example Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * revert file permissions Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * π§ refactor(data): Polish 3dAdam dataset (#3002) * Add changelog + fix dataset location Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * revert changes to example Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * revert file permissions Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * Fix tests Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> --------- Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * revert examples Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * revert file permissions Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * Add imagecodecs dependency Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> * Apply suggestion from @samet-akcay Co-authored-by: Samet Akcay <samet.akcay@intel.com> Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com> --------- Signed-off-by: samet-akcay <samet.akcay@intel.com> Signed-off-by: Paul McHard <paulmchard@gmail.com> Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com> Signed-off-by: Paul McHard <32065439+PaulMcHard@users.noreply.github.com> Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com> Co-authored-by: Paul McHard <32065439+PaulMcHard@users.noreply.github.com> Co-authored-by: Samet Akcay <samet.akcay@intel.com> Co-authored-by: Rune <60315601+monzelr@users.noreply.github.com> Co-authored-by: Rajesh Gangireddy <rajesh.gangireddy@intel.com>
π Description
β¨ Changes
Select what type of change your PR is:
β 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.