Skip to content

Conversation

PaulMcHard
Copy link
Contributor

@PaulMcHard PaulMcHard commented Oct 1, 2025

πŸ“ Description

✨ Changes

Select what type of change your PR is:

  • πŸš€ New feature (non-breaking change which adds functionality)
  • πŸ“š Documentation update

βœ… Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • πŸ“š I have made the necessary updates to the documentation (if applicable).
  • πŸ§ͺ I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

@rajeshgangireddy rajeshgangireddy self-requested a review October 1, 2025 12:23
Copy link
Contributor

@ashwinvaidya17 ashwinvaidya17 left a 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

class DummyImageDatasetGenerator(DummyDatasetGenerator):

If not, I can create a follow-up PR for the tests.

Copy link
Contributor

@rajeshgangireddy rajeshgangireddy left a 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

@PaulMcHard
Copy link
Contributor Author

Thank you for the feedback, I have enabled pre-commit hooks and resolved the given comments, much appreciated.

samet-akcay and others added 7 commits October 1, 2025 16:52
…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>
@PaulMcHard
Copy link
Contributor Author

Please advise if there's any changes required to correct for the unit test which is timing out.

PaulMcHard and others added 2 commits October 3, 2025 14:21
@rajeshgangireddy
Copy link
Contributor

I was testing this locally, the download file link is still not the correct one I guess.
I think we need to use url="https://huggingface.co/datasets/pmchard/3D-ADAM_anomalib/resolve/main/adam3d_cropped.zip",
This works.

@PaulMcHard
Copy link
Contributor Author

All outstanding issues should now be resolved. Please let me know if there's anything else needing addressed.

Copy link
Contributor

@ashwinvaidya17 ashwinvaidya17 left a 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.

  1. Why are the file permissions changed?
  2. Why is the uv lock file updated? I can see that almost all lines have been removed.

@PaulMcHard
Copy link
Contributor Author

Thanks for the update, two questions.

  1. Why are the file permissions changed?
  2. Why is the uv lock file updated? I can see that almost all lines have been removed.

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>
@PaulMcHard
Copy link
Contributor Author

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.

@ashwinvaidya17 ashwinvaidya17 self-requested a review October 7, 2025 07:10
@ashwinvaidya17 ashwinvaidya17 changed the base branch from main to feature/dataset/3dadam October 7, 2025 07:38
@ashwinvaidya17 ashwinvaidya17 merged commit 1c99f8b into open-edge-platform:feature/dataset/3dadam Oct 7, 2025
13 of 14 checks passed
ashwinvaidya17 added a commit that referenced this pull request Oct 8, 2025
* πŸš€ 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ“– [STORY] Integrating the 3D-ADAM Dataset into Anomalib

5 participants