Commit 28815db
authored
🐞 fix(utils): revert
* 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>OptionalImport class to handle missing optional dependencies (#2956)1 parent bf7e5bc commit 28815db
File tree
7 files changed
+60
-94
lines changed- src/anomalib
- data/utils
- loggers
- models/image/vlm_ad/backends
- utils
7 files changed
+60
-94
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
This file was deleted.
0 commit comments