diff --git a/anomalib/__init__.py b/anomalib/__init__.py index f3389bf81a..ca82999c10 100644 --- a/anomalib/__init__.py +++ b/anomalib/__init__.py @@ -1,17 +1,6 @@ """Anomalib library for research and benchmarking.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 __version__ = "0.3.5" diff --git a/anomalib/config/__init__.py b/anomalib/config/__init__.py index e2607d88f9..10da51c62f 100644 --- a/anomalib/config/__init__.py +++ b/anomalib/config/__init__.py @@ -1,18 +1,7 @@ """Utilities for parsing model configuration.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .config import ( get_configurable_parameters, diff --git a/anomalib/config/config.py b/anomalib/config/config.py index dcb11862fc..6312c1012f 100644 --- a/anomalib/config/config.py +++ b/anomalib/config/config.py @@ -1,18 +1,7 @@ """Get configurable parameters.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 # TODO: This would require a new design. # TODO: https://jira.devtools.intel.com/browse/IAAALD-149 diff --git a/anomalib/data/__init__.py b/anomalib/data/__init__.py index 1e1bcc2235..8c295a1061 100644 --- a/anomalib/data/__init__.py +++ b/anomalib/data/__init__.py @@ -1,18 +1,7 @@ """Anomalib Datasets.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import Union diff --git a/anomalib/data/btech.py b/anomalib/data/btech.py index a4e45164b5..8b6bac792b 100644 --- a/anomalib/data/btech.py +++ b/anomalib/data/btech.py @@ -6,19 +6,8 @@ extracts the dataset and create PyTorch data objects. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import shutil diff --git a/anomalib/data/folder.py b/anomalib/data/folder.py index b68b9fdf50..0f3b47adbd 100644 --- a/anomalib/data/folder.py +++ b/anomalib/data/folder.py @@ -3,19 +3,8 @@ This script creates a custom dataset from a folder. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import warnings diff --git a/anomalib/data/inference.py b/anomalib/data/inference.py index d25626926e..98fdbee6ac 100644 --- a/anomalib/data/inference.py +++ b/anomalib/data/inference.py @@ -1,18 +1,7 @@ """Inference Dataset.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Any, Optional, Tuple, Union diff --git a/anomalib/data/mvtec.py b/anomalib/data/mvtec.py index 8c6d918330..9b45699d64 100644 --- a/anomalib/data/mvtec.py +++ b/anomalib/data/mvtec.py @@ -24,19 +24,8 @@ 9584-9592, 2019, DOI: 10.1109/CVPR.2019.00982. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import tarfile diff --git a/anomalib/data/utils/__init__.py b/anomalib/data/utils/__init__.py index 7a3c2ed506..53cf04e4fd 100644 --- a/anomalib/data/utils/__init__.py +++ b/anomalib/data/utils/__init__.py @@ -1,18 +1,7 @@ """Helper utilities for data.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .download import DownloadProgressBar, hash_check from .generators import random_2d_perlin diff --git a/anomalib/data/utils/download.py b/anomalib/data/utils/download.py index c043aa1a77..eefe001f44 100644 --- a/anomalib/data/utils/download.py +++ b/anomalib/data/utils/download.py @@ -1,18 +1,7 @@ """Helper to show progress bars with `urlretrieve`, check hash of file.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import hashlib import io diff --git a/anomalib/data/utils/image.py b/anomalib/data/utils/image.py index 9df5abd43e..c8c5039882 100644 --- a/anomalib/data/utils/image.py +++ b/anomalib/data/utils/image.py @@ -1,18 +1,7 @@ """Image Utils.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import math import warnings diff --git a/anomalib/data/utils/split.py b/anomalib/data/utils/split.py index 2fedc17d49..311928bb6b 100644 --- a/anomalib/data/utils/split.py +++ b/anomalib/data/utils/split.py @@ -8,19 +8,8 @@ - when the dataset doesn't have a validation set. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import random from typing import Optional diff --git a/anomalib/deploy/__init__.py b/anomalib/deploy/__init__.py index 65b769947d..ff7eb94f19 100644 --- a/anomalib/deploy/__init__.py +++ b/anomalib/deploy/__init__.py @@ -1,18 +1,7 @@ """Functions for Inference and model deployment.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .inferencers import Inferencer, OpenVINOInferencer, TorchInferencer from .optimize import export_convert, get_model_metadata diff --git a/anomalib/deploy/inferencers/__init__.py b/anomalib/deploy/inferencers/__init__.py index dd54346118..f47ece3425 100644 --- a/anomalib/deploy/inferencers/__init__.py +++ b/anomalib/deploy/inferencers/__init__.py @@ -1,18 +1,7 @@ """Inferencers for Torch and OpenVINO.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .base_inferencer import Inferencer from .openvino_inferencer import OpenVINOInferencer diff --git a/anomalib/deploy/inferencers/base_inferencer.py b/anomalib/deploy/inferencers/base_inferencer.py index a724f18844..1387c8c3e4 100644 --- a/anomalib/deploy/inferencers/base_inferencer.py +++ b/anomalib/deploy/inferencers/base_inferencer.py @@ -1,18 +1,7 @@ """Base Inferencer for Torch and OpenVINO.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from abc import ABC, abstractmethod from pathlib import Path diff --git a/anomalib/deploy/inferencers/openvino_inferencer.py b/anomalib/deploy/inferencers/openvino_inferencer.py index 280da3b4a7..804abb52d0 100644 --- a/anomalib/deploy/inferencers/openvino_inferencer.py +++ b/anomalib/deploy/inferencers/openvino_inferencer.py @@ -1,18 +1,7 @@ """This module contains inference-related abstract class and its Torch and OpenVINO implementations.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from importlib.util import find_spec from pathlib import Path diff --git a/anomalib/deploy/inferencers/torch_inferencer.py b/anomalib/deploy/inferencers/torch_inferencer.py index 9a9ef0cb4f..795149e6c6 100644 --- a/anomalib/deploy/inferencers/torch_inferencer.py +++ b/anomalib/deploy/inferencers/torch_inferencer.py @@ -1,18 +1,7 @@ """This module contains Torch inference implementations.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Any, Dict, Optional, Union diff --git a/anomalib/deploy/optimize.py b/anomalib/deploy/optimize.py index b32e82e2ae..721e754360 100644 --- a/anomalib/deploy/optimize.py +++ b/anomalib/deploy/optimize.py @@ -1,19 +1,7 @@ """Utilities for optimization and OpenVINO conversion.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. - +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import json import os diff --git a/anomalib/models/__init__.py b/anomalib/models/__init__.py index 891ff4398c..13243b8613 100644 --- a/anomalib/models/__init__.py +++ b/anomalib/models/__init__.py @@ -1,18 +1,7 @@ """Load Anomaly Model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/anomalib/models/cflow/__init__.py b/anomalib/models/cflow/__init__.py index 60902a438e..b1025613f8 100644 --- a/anomalib/models/cflow/__init__.py +++ b/anomalib/models/cflow/__init__.py @@ -1,18 +1,7 @@ """Real-Time Unsupervised Anomaly Detection via Conditional Normalizing Flows.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Cflow, CflowLightning diff --git a/anomalib/models/cflow/anomaly_map.py b/anomalib/models/cflow/anomaly_map.py index 8e6ec82179..b4cfc134ba 100644 --- a/anomalib/models/cflow/anomaly_map.py +++ b/anomalib/models/cflow/anomaly_map.py @@ -1,18 +1,7 @@ """Anomaly Map Generator for CFlow model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Tuple, Union, cast diff --git a/anomalib/models/cflow/lightning_model.py b/anomalib/models/cflow/lightning_model.py index b6a7f3c0ec..e5547a0278 100644 --- a/anomalib/models/cflow/lightning_model.py +++ b/anomalib/models/cflow/lightning_model.py @@ -3,19 +3,8 @@ https://arxiv.org/pdf/2107.12571v1.pdf """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Tuple, Union diff --git a/anomalib/models/cflow/torch_model.py b/anomalib/models/cflow/torch_model.py index 2d22d15631..02813a3530 100644 --- a/anomalib/models/cflow/torch_model.py +++ b/anomalib/models/cflow/torch_model.py @@ -1,18 +1,7 @@ """PyTorch model for CFlow model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Tuple diff --git a/anomalib/models/cflow/utils.py b/anomalib/models/cflow/utils.py index 4917be164f..e2fd0e592e 100644 --- a/anomalib/models/cflow/utils.py +++ b/anomalib/models/cflow/utils.py @@ -1,18 +1,7 @@ """Helper functions for CFlow implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import math diff --git a/anomalib/models/components/__init__.py b/anomalib/models/components/__init__.py index f4d6f70f8a..5d4399ec87 100644 --- a/anomalib/models/components/__init__.py +++ b/anomalib/models/components/__init__.py @@ -1,18 +1,7 @@ """Components used within the models.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .base import AnomalyModule, DynamicBufferModule from .dimensionality_reduction import PCA, SparseRandomProjection diff --git a/anomalib/models/components/base/__init__.py b/anomalib/models/components/base/__init__.py index fdcf2bee5a..5e9dc00788 100644 --- a/anomalib/models/components/base/__init__.py +++ b/anomalib/models/components/base/__init__.py @@ -1,18 +1,7 @@ """Base classes for all anomaly components.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .anomaly_module import AnomalyModule from .dynamic_module import DynamicBufferModule diff --git a/anomalib/models/components/base/anomaly_module.py b/anomalib/models/components/base/anomaly_module.py index 34e314d181..6e6dc2936a 100644 --- a/anomalib/models/components/base/anomaly_module.py +++ b/anomalib/models/components/base/anomaly_module.py @@ -1,18 +1,7 @@ """Base Anomaly Module for Training Task.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from abc import ABC diff --git a/anomalib/models/components/base/dynamic_module.py b/anomalib/models/components/base/dynamic_module.py index 1255e01d92..d0c9241b37 100644 --- a/anomalib/models/components/base/dynamic_module.py +++ b/anomalib/models/components/base/dynamic_module.py @@ -1,18 +1,7 @@ """Dynamic Buffer Module.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from abc import ABC diff --git a/anomalib/models/components/dimensionality_reduction/__init__.py b/anomalib/models/components/dimensionality_reduction/__init__.py index b31a5ea825..d69c691bf0 100644 --- a/anomalib/models/components/dimensionality_reduction/__init__.py +++ b/anomalib/models/components/dimensionality_reduction/__init__.py @@ -1,18 +1,7 @@ """Algorithms for decomposition and dimensionality reduction.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .pca import PCA from .random_projection import SparseRandomProjection diff --git a/anomalib/models/components/dimensionality_reduction/pca.py b/anomalib/models/components/dimensionality_reduction/pca.py index ef7a22f3c0..c3f37bf2a5 100644 --- a/anomalib/models/components/dimensionality_reduction/pca.py +++ b/anomalib/models/components/dimensionality_reduction/pca.py @@ -1,18 +1,7 @@ """Principle Component Analysis (PCA) with PyTorch.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Union diff --git a/anomalib/models/components/dimensionality_reduction/random_projection.py b/anomalib/models/components/dimensionality_reduction/random_projection.py index f06f7b0db5..f239595d2a 100644 --- a/anomalib/models/components/dimensionality_reduction/random_projection.py +++ b/anomalib/models/components/dimensionality_reduction/random_projection.py @@ -4,19 +4,8 @@ Sparse Random Projection using PyTorch Operations """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Optional diff --git a/anomalib/models/components/feature_extractors/__init__.py b/anomalib/models/components/feature_extractors/__init__.py index 984b5eb3a2..0922fd3701 100644 --- a/anomalib/models/components/feature_extractors/__init__.py +++ b/anomalib/models/components/feature_extractors/__init__.py @@ -1,18 +1,7 @@ """Feature extractors.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .feature_extractor import FeatureExtractor diff --git a/anomalib/models/components/feature_extractors/feature_extractor.py b/anomalib/models/components/feature_extractors/feature_extractor.py index f616d23280..b9e7d62858 100644 --- a/anomalib/models/components/feature_extractors/feature_extractor.py +++ b/anomalib/models/components/feature_extractors/feature_extractor.py @@ -3,19 +3,8 @@ This script extracts features from a CNN network """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Callable, Dict, Iterable diff --git a/anomalib/models/components/filters/blur.py b/anomalib/models/components/filters/blur.py index 68e09e2cd1..20513cd8df 100644 --- a/anomalib/models/components/filters/blur.py +++ b/anomalib/models/components/filters/blur.py @@ -1,4 +1,5 @@ """Gaussian blurring via pytorch.""" + from typing import Tuple, Union from kornia.filters import get_gaussian_kernel2d diff --git a/anomalib/models/components/sampling/__init__.py b/anomalib/models/components/sampling/__init__.py index 26dac37289..47c842123f 100644 --- a/anomalib/models/components/sampling/__init__.py +++ b/anomalib/models/components/sampling/__init__.py @@ -1,18 +1,7 @@ """Sampling methods.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .k_center_greedy import KCenterGreedy diff --git a/anomalib/models/components/stats/__init__.py b/anomalib/models/components/stats/__init__.py index 829c0f75b2..c65aef1caf 100644 --- a/anomalib/models/components/stats/__init__.py +++ b/anomalib/models/components/stats/__init__.py @@ -1,18 +1,7 @@ """Statistical functions.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .kde import GaussianKDE from .multi_variate_gaussian import MultiVariateGaussian diff --git a/anomalib/models/components/stats/kde.py b/anomalib/models/components/stats/kde.py index 6fb66bb6f4..0929165869 100644 --- a/anomalib/models/components/stats/kde.py +++ b/anomalib/models/components/stats/kde.py @@ -1,18 +1,7 @@ """Gaussian Kernel Density Estimation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import math from typing import Optional diff --git a/anomalib/models/components/stats/multi_variate_gaussian.py b/anomalib/models/components/stats/multi_variate_gaussian.py index e9926ffe6b..14eb8f3c73 100644 --- a/anomalib/models/components/stats/multi_variate_gaussian.py +++ b/anomalib/models/components/stats/multi_variate_gaussian.py @@ -1,18 +1,7 @@ """Multi Variate Gaussian Distribution.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Any, List, Optional diff --git a/anomalib/models/dfkde/__init__.py b/anomalib/models/dfkde/__init__.py index 2b4a83f385..09877ab3de 100644 --- a/anomalib/models/dfkde/__init__.py +++ b/anomalib/models/dfkde/__init__.py @@ -1,18 +1,7 @@ """Deep Feature Kernel Density Estimation model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Dfkde, DfkdeLightning diff --git a/anomalib/models/dfkde/lightning_model.py b/anomalib/models/dfkde/lightning_model.py index f076d3eb9f..b89ce8e3f0 100644 --- a/anomalib/models/dfkde/lightning_model.py +++ b/anomalib/models/dfkde/lightning_model.py @@ -1,18 +1,7 @@ """DFKDE: Deep Feature Kernel Density Estimation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import List, Union diff --git a/anomalib/models/dfkde/torch_model.py b/anomalib/models/dfkde/torch_model.py index 18b6a2b694..b0bec2be9b 100644 --- a/anomalib/models/dfkde/torch_model.py +++ b/anomalib/models/dfkde/torch_model.py @@ -1,18 +1,7 @@ """Normality model of DFKDE.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import random diff --git a/anomalib/models/dfm/__init__.py b/anomalib/models/dfm/__init__.py index 8db2335d4d..88b352afd4 100644 --- a/anomalib/models/dfm/__init__.py +++ b/anomalib/models/dfm/__init__.py @@ -1,18 +1,7 @@ """Deep Feature Extraction (DFM) model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Dfm, DfmLightning diff --git a/anomalib/models/dfm/lightning_model.py b/anomalib/models/dfm/lightning_model.py index a0fba56e01..0bd098a6cb 100644 --- a/anomalib/models/dfm/lightning_model.py +++ b/anomalib/models/dfm/lightning_model.py @@ -1,18 +1,7 @@ """DFM: Deep Feature Kernel Density Estimation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import List, Union diff --git a/anomalib/models/dfm/torch_model.py b/anomalib/models/dfm/torch_model.py index 89890fc301..97c1e3dc6d 100644 --- a/anomalib/models/dfm/torch_model.py +++ b/anomalib/models/dfm/torch_model.py @@ -1,18 +1,7 @@ """PyTorch model for DFM model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import math diff --git a/anomalib/models/fastflow/__init__.py b/anomalib/models/fastflow/__init__.py index 7bb7bdf0b3..e48c928f8c 100644 --- a/anomalib/models/fastflow/__init__.py +++ b/anomalib/models/fastflow/__init__.py @@ -2,7 +2,6 @@ # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# from .lightning_model import Fastflow, FastflowLightning from .loss import FastflowLoss diff --git a/anomalib/models/fastflow/anomaly_map.py b/anomalib/models/fastflow/anomaly_map.py index ad530b43bc..15d6554e7c 100644 --- a/anomalib/models/fastflow/anomaly_map.py +++ b/anomalib/models/fastflow/anomaly_map.py @@ -2,7 +2,6 @@ # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# from typing import List, Tuple, Union diff --git a/anomalib/models/fastflow/lightning_model.py b/anomalib/models/fastflow/lightning_model.py index c488f9d6e3..e3d4bb9d78 100644 --- a/anomalib/models/fastflow/lightning_model.py +++ b/anomalib/models/fastflow/lightning_model.py @@ -2,7 +2,6 @@ # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# from typing import Tuple, Union diff --git a/anomalib/models/fastflow/torch_model.py b/anomalib/models/fastflow/torch_model.py index 2aaf827ee9..577323ac28 100644 --- a/anomalib/models/fastflow/torch_model.py +++ b/anomalib/models/fastflow/torch_model.py @@ -8,7 +8,6 @@ # Modified # Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# from typing import Callable, List, Tuple, Union diff --git a/anomalib/models/ganomaly/__init__.py b/anomalib/models/ganomaly/__init__.py index efadcdee2c..831d9003ad 100644 --- a/anomalib/models/ganomaly/__init__.py +++ b/anomalib/models/ganomaly/__init__.py @@ -1,18 +1,7 @@ """GANomaly Model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Ganomaly, GanomalyLightning diff --git a/anomalib/models/ganomaly/lightning_model.py b/anomalib/models/ganomaly/lightning_model.py index aa7aa4f865..f5c42c8e4d 100644 --- a/anomalib/models/ganomaly/lightning_model.py +++ b/anomalib/models/ganomaly/lightning_model.py @@ -3,19 +3,8 @@ https://arxiv.org/abs/1805.06725 """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import Dict, List, Tuple, Union diff --git a/anomalib/models/ganomaly/torch_model.py b/anomalib/models/ganomaly/torch_model.py index ccd273ea54..fbf67fc1b5 100644 --- a/anomalib/models/ganomaly/torch_model.py +++ b/anomalib/models/ganomaly/torch_model.py @@ -1,15 +1,13 @@ -# Copyright (c) 2018-2022 Samet Akcay, Durham University, UK -# SPDX-License-Identifier: MIT -# -# Copyright (C) 2020-2022 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - """Torch models defining encoder, decoder, Generator and Discriminator. Code adapted from https://github.com/samet-akcay/ganomaly. """ +# Copyright (c) 2018-2022 Samet Akcay, Durham University, UK +# SPDX-License-Identifier: MIT +# +# Copyright (C) 2020-2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import math from typing import Tuple, Union diff --git a/anomalib/models/padim/__init__.py b/anomalib/models/padim/__init__.py index a9fa469ae4..b42fdb319a 100644 --- a/anomalib/models/padim/__init__.py +++ b/anomalib/models/padim/__init__.py @@ -1,18 +1,7 @@ """PADIM model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Padim, PadimLightning diff --git a/anomalib/models/padim/anomaly_map.py b/anomalib/models/padim/anomaly_map.py index 2ca2d78bec..cb35080d50 100644 --- a/anomalib/models/padim/anomaly_map.py +++ b/anomalib/models/padim/anomaly_map.py @@ -1,18 +1,7 @@ """Anomaly Map Generator for the PaDiM model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Tuple, Union diff --git a/anomalib/models/padim/lightning_model.py b/anomalib/models/padim/lightning_model.py index ac90d3c9de..c4480e906c 100644 --- a/anomalib/models/padim/lightning_model.py +++ b/anomalib/models/padim/lightning_model.py @@ -3,19 +3,8 @@ Paper https://arxiv.org/abs/2011.08785 """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import List, Tuple, Union diff --git a/anomalib/models/padim/torch_model.py b/anomalib/models/padim/torch_model.py index fb00f0057b..760ee0069e 100644 --- a/anomalib/models/padim/torch_model.py +++ b/anomalib/models/padim/torch_model.py @@ -1,18 +1,7 @@ """PyTorch model for the PaDiM model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from random import sample from typing import Dict, List, Optional, Tuple diff --git a/anomalib/models/patchcore/__init__.py b/anomalib/models/patchcore/__init__.py index f605fba80b..309e40331d 100644 --- a/anomalib/models/patchcore/__init__.py +++ b/anomalib/models/patchcore/__init__.py @@ -1,18 +1,7 @@ """PatchCore model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Patchcore, PatchcoreLightning diff --git a/anomalib/models/patchcore/anomaly_map.py b/anomalib/models/patchcore/anomaly_map.py index 379d9c0f3a..00e8eafbe0 100644 --- a/anomalib/models/patchcore/anomaly_map.py +++ b/anomalib/models/patchcore/anomaly_map.py @@ -1,18 +1,7 @@ """Anomaly Map Generator for the PatchCore model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Tuple, Union diff --git a/anomalib/models/patchcore/lightning_model.py b/anomalib/models/patchcore/lightning_model.py index 95b11cd61f..1ba1ffe929 100644 --- a/anomalib/models/patchcore/lightning_model.py +++ b/anomalib/models/patchcore/lightning_model.py @@ -3,19 +3,8 @@ Paper https://arxiv.org/abs/2106.08265. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import List, Tuple, Union diff --git a/anomalib/models/patchcore/torch_model.py b/anomalib/models/patchcore/torch_model.py index b0a9129a93..3eafb0d17c 100644 --- a/anomalib/models/patchcore/torch_model.py +++ b/anomalib/models/patchcore/torch_model.py @@ -1,18 +1,7 @@ """PyTorch model for the PatchCore model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, List, Optional, Tuple, Union diff --git a/anomalib/models/reverse_distillation/lightning_model.py b/anomalib/models/reverse_distillation/lightning_model.py index f7c988571e..facb496663 100644 --- a/anomalib/models/reverse_distillation/lightning_model.py +++ b/anomalib/models/reverse_distillation/lightning_model.py @@ -4,18 +4,7 @@ """ # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, List, Tuple, Union diff --git a/anomalib/models/reverse_distillation/loss.py b/anomalib/models/reverse_distillation/loss.py index 737be2ada6..3fd6d270a1 100644 --- a/anomalib/models/reverse_distillation/loss.py +++ b/anomalib/models/reverse_distillation/loss.py @@ -1,18 +1,7 @@ """Loss function for Reverse Distillation.""" # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 from typing import List diff --git a/anomalib/models/reverse_distillation/torch_model.py b/anomalib/models/reverse_distillation/torch_model.py index 2177b46bd0..1cf03a6e14 100644 --- a/anomalib/models/reverse_distillation/torch_model.py +++ b/anomalib/models/reverse_distillation/torch_model.py @@ -1,18 +1,7 @@ """PyTorch model for Reverse Distillation.""" # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 from typing import List, Optional, Tuple, Union diff --git a/anomalib/models/stfpm/__init__.py b/anomalib/models/stfpm/__init__.py index a98b048cfd..d77c246b47 100644 --- a/anomalib/models/stfpm/__init__.py +++ b/anomalib/models/stfpm/__init__.py @@ -1,18 +1,7 @@ """STFPM Model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .lightning_model import Stfpm, StfpmLightning diff --git a/anomalib/models/stfpm/anomaly_map.py b/anomalib/models/stfpm/anomaly_map.py index a087d90744..4e6bc86552 100644 --- a/anomalib/models/stfpm/anomaly_map.py +++ b/anomalib/models/stfpm/anomaly_map.py @@ -1,18 +1,7 @@ """Anomaly Map Generator for the STFPM model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Tuple, Union diff --git a/anomalib/models/stfpm/lightning_model.py b/anomalib/models/stfpm/lightning_model.py index 33651716bf..cc2004c3c1 100644 --- a/anomalib/models/stfpm/lightning_model.py +++ b/anomalib/models/stfpm/lightning_model.py @@ -3,19 +3,8 @@ https://arxiv.org/abs/2103.04257 """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Tuple, Union diff --git a/anomalib/models/stfpm/torch_model.py b/anomalib/models/stfpm/torch_model.py index ca3485812f..81f7f32c81 100644 --- a/anomalib/models/stfpm/torch_model.py +++ b/anomalib/models/stfpm/torch_model.py @@ -1,18 +1,7 @@ """PyTorch model for the STFPM model implementation.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, List, Optional, Tuple diff --git a/anomalib/post_processing/__init__.py b/anomalib/post_processing/__init__.py index 5ddc86bf8f..dcdf1ab7de 100644 --- a/anomalib/post_processing/__init__.py +++ b/anomalib/post_processing/__init__.py @@ -1,18 +1,7 @@ """Methods to help post-process raw model outputs.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .post_process import ( add_anomalous_label, diff --git a/anomalib/post_processing/normalization/__init__.py b/anomalib/post_processing/normalization/__init__.py index c0b064dcd2..fb2c272cc2 100644 --- a/anomalib/post_processing/normalization/__init__.py +++ b/anomalib/post_processing/normalization/__init__.py @@ -1,15 +1,4 @@ """Tools for anomaly score normalization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/anomalib/post_processing/normalization/cdf.py b/anomalib/post_processing/normalization/cdf.py index 5a36c2f15a..e76425169c 100644 --- a/anomalib/post_processing/normalization/cdf.py +++ b/anomalib/post_processing/normalization/cdf.py @@ -1,18 +1,7 @@ """Tools for CDF normalization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Optional, Union diff --git a/anomalib/post_processing/normalization/min_max.py b/anomalib/post_processing/normalization/min_max.py index 4967389658..7fe751433e 100644 --- a/anomalib/post_processing/normalization/min_max.py +++ b/anomalib/post_processing/normalization/min_max.py @@ -1,18 +1,7 @@ """Tools for min-max normalization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Union diff --git a/anomalib/post_processing/post_process.py b/anomalib/post_processing/post_process.py index 85bb8b779d..e8c4debbad 100644 --- a/anomalib/post_processing/post_process.py +++ b/anomalib/post_processing/post_process.py @@ -1,18 +1,7 @@ """Post Process This module contains utils function to apply post-processing to the output predictions.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import math diff --git a/anomalib/post_processing/visualizer.py b/anomalib/post_processing/visualizer.py index 1eb03246c8..409a52b4a2 100644 --- a/anomalib/post_processing/visualizer.py +++ b/anomalib/post_processing/visualizer.py @@ -1,18 +1,7 @@ """Anomaly Visualization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass, field from pathlib import Path diff --git a/anomalib/pre_processing/__init__.py b/anomalib/pre_processing/__init__.py index 6313d91ef1..b7574e659f 100644 --- a/anomalib/pre_processing/__init__.py +++ b/anomalib/pre_processing/__init__.py @@ -1,18 +1,7 @@ """Utilities for pre-processing the input before passing to the model.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .pre_process import PreProcessor from .tiler import Tiler diff --git a/anomalib/pre_processing/pre_process.py b/anomalib/pre_processing/pre_process.py index b8ec079aa5..28740496eb 100644 --- a/anomalib/pre_processing/pre_process.py +++ b/anomalib/pre_processing/pre_process.py @@ -4,19 +4,8 @@ to an input image before the forward-pass stage. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Optional, Tuple, Union diff --git a/anomalib/pre_processing/tiler.py b/anomalib/pre_processing/tiler.py index 1b37a13c4d..08f4687f40 100644 --- a/anomalib/pre_processing/tiler.py +++ b/anomalib/pre_processing/tiler.py @@ -1,18 +1,7 @@ """Image Tiler.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from itertools import product from math import ceil diff --git a/anomalib/pre_processing/transforms/__init__.py b/anomalib/pre_processing/transforms/__init__.py index 66cedf5d45..bb16f46325 100644 --- a/anomalib/pre_processing/transforms/__init__.py +++ b/anomalib/pre_processing/transforms/__init__.py @@ -1,18 +1,7 @@ """Anomalib Data Transforms.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .custom import Denormalize, ToNumpy diff --git a/anomalib/pre_processing/transforms/custom.py b/anomalib/pre_processing/transforms/custom.py index 1f3b6d398e..1f99a19a19 100644 --- a/anomalib/pre_processing/transforms/custom.py +++ b/anomalib/pre_processing/transforms/custom.py @@ -1,18 +1,7 @@ """Dataset Utils.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Optional, Tuple diff --git a/anomalib/utils/__init__.py b/anomalib/utils/__init__.py index 4c9027199a..8ffe7654fe 100644 --- a/anomalib/utils/__init__.py +++ b/anomalib/utils/__init__.py @@ -1,15 +1,4 @@ """Helpers for downloading files, calculating metrics, computing anomaly maps, and visualization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/anomalib/utils/callbacks/__init__.py b/anomalib/utils/callbacks/__init__.py index 974084002d..1a7b156f3c 100644 --- a/anomalib/utils/callbacks/__init__.py +++ b/anomalib/utils/callbacks/__init__.py @@ -1,18 +1,7 @@ """Callbacks for Anomalib models.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/anomalib/utils/callbacks/cdf_normalization.py b/anomalib/utils/callbacks/cdf_normalization.py index 4506644a6a..e4145accd9 100644 --- a/anomalib/utils/callbacks/cdf_normalization.py +++ b/anomalib/utils/callbacks/cdf_normalization.py @@ -1,18 +1,7 @@ """Anomaly Score Normalization Callback.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging from typing import Any, Dict, Optional diff --git a/anomalib/utils/callbacks/graph.py b/anomalib/utils/callbacks/graph.py index 41b109d34a..321862a309 100644 --- a/anomalib/utils/callbacks/graph.py +++ b/anomalib/utils/callbacks/graph.py @@ -1,18 +1,7 @@ """Log model graph to respective logger.""" # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 import torch from pytorch_lightning import Callback, LightningModule, Trainer diff --git a/anomalib/utils/callbacks/metrics_configuration.py b/anomalib/utils/callbacks/metrics_configuration.py index 32410ab78c..56d6630af4 100644 --- a/anomalib/utils/callbacks/metrics_configuration.py +++ b/anomalib/utils/callbacks/metrics_configuration.py @@ -1,18 +1,7 @@ """Metrics Configuration Callback.""" # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 from typing import List, Optional diff --git a/anomalib/utils/callbacks/min_max_normalization.py b/anomalib/utils/callbacks/min_max_normalization.py index fee2c935c7..b51a27e9a5 100644 --- a/anomalib/utils/callbacks/min_max_normalization.py +++ b/anomalib/utils/callbacks/min_max_normalization.py @@ -1,18 +1,7 @@ """Anomaly Score Normalization Callback that uses min-max normalization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Any, Dict diff --git a/anomalib/utils/callbacks/model_loader.py b/anomalib/utils/callbacks/model_loader.py index 2dfc1a183f..a89b5ecd68 100644 --- a/anomalib/utils/callbacks/model_loader.py +++ b/anomalib/utils/callbacks/model_loader.py @@ -1,18 +1,7 @@ """Callback that loads model weights from the state dict.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging diff --git a/anomalib/utils/callbacks/nncf/__init__.py b/anomalib/utils/callbacks/nncf/__init__.py index 37ff514a8d..074a1bd861 100644 --- a/anomalib/utils/callbacks/nncf/__init__.py +++ b/anomalib/utils/callbacks/nncf/__init__.py @@ -1,15 +1,4 @@ """Integration NNCF.""" -# Copyright (C) 2021 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/anomalib/utils/callbacks/nncf/callback.py b/anomalib/utils/callbacks/nncf/callback.py index 42a390e0a4..da197ba005 100644 --- a/anomalib/utils/callbacks/nncf/callback.py +++ b/anomalib/utils/callbacks/nncf/callback.py @@ -1,18 +1,7 @@ """Callbacks for NNCF optimization.""" # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 import os from typing import Any, Dict, Optional diff --git a/anomalib/utils/callbacks/nncf/utils.py b/anomalib/utils/callbacks/nncf/utils.py index 2f60fa591a..b387034a67 100644 --- a/anomalib/utils/callbacks/nncf/utils.py +++ b/anomalib/utils/callbacks/nncf/utils.py @@ -1,18 +1,7 @@ """Utils for NNCf optimization.""" # Copyright (C) 2022 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# SPDX-License-Identifier: Apache-2.0 import logging from copy import copy diff --git a/anomalib/utils/callbacks/openvino.py b/anomalib/utils/callbacks/openvino.py index e0718d19db..8b2ff29338 100644 --- a/anomalib/utils/callbacks/openvino.py +++ b/anomalib/utils/callbacks/openvino.py @@ -1,18 +1,7 @@ """Callback that compresses a trained model by first exporting to .onnx format, and then converting to OpenVINO IR.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/anomalib/utils/callbacks/tiler_configuration.py b/anomalib/utils/callbacks/tiler_configuration.py index 55705bdf96..227be27539 100644 --- a/anomalib/utils/callbacks/tiler_configuration.py +++ b/anomalib/utils/callbacks/tiler_configuration.py @@ -1,18 +1,7 @@ """Tiler Callback.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Optional, Sequence, Union diff --git a/anomalib/utils/callbacks/timer.py b/anomalib/utils/callbacks/timer.py index 9a06e127fe..99360ad981 100644 --- a/anomalib/utils/callbacks/timer.py +++ b/anomalib/utils/callbacks/timer.py @@ -1,18 +1,7 @@ """Callback to measure training and testing time of a PyTorch Lightning module.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import time diff --git a/anomalib/utils/callbacks/visualizer/__init__.py b/anomalib/utils/callbacks/visualizer/__init__.py index c1f780968d..3daa165215 100644 --- a/anomalib/utils/callbacks/visualizer/__init__.py +++ b/anomalib/utils/callbacks/visualizer/__init__.py @@ -1,4 +1,8 @@ """Callbacks to visualize anomaly detection performance.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from .visualizer_base import BaseVisualizerCallback from .visualizer_image import ImageVisualizerCallback from .visualizer_metric import MetricVisualizerCallback diff --git a/anomalib/utils/callbacks/visualizer/visualizer_base.py b/anomalib/utils/callbacks/visualizer/visualizer_base.py index da0bb609aa..d1b131823d 100644 --- a/anomalib/utils/callbacks/visualizer/visualizer_base.py +++ b/anomalib/utils/callbacks/visualizer/visualizer_base.py @@ -1,18 +1,7 @@ """Base Visualizer Callback.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Union, cast diff --git a/anomalib/utils/callbacks/visualizer/visualizer_image.py b/anomalib/utils/callbacks/visualizer/visualizer_image.py index 2902df4fb9..d9b06c5412 100644 --- a/anomalib/utils/callbacks/visualizer/visualizer_image.py +++ b/anomalib/utils/callbacks/visualizer/visualizer_image.py @@ -1,18 +1,7 @@ """Image Visualizer Callback.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Any, Optional diff --git a/anomalib/utils/callbacks/visualizer/visualizer_metric.py b/anomalib/utils/callbacks/visualizer/visualizer_metric.py index 5676e7adad..0350cde878 100644 --- a/anomalib/utils/callbacks/visualizer/visualizer_metric.py +++ b/anomalib/utils/callbacks/visualizer/visualizer_metric.py @@ -1,18 +1,7 @@ """Metric Visualizer Callback.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/anomalib/utils/loggers/__init__.py b/anomalib/utils/loggers/__init__.py index ad03e26de5..e98a8c578f 100644 --- a/anomalib/utils/loggers/__init__.py +++ b/anomalib/utils/loggers/__init__.py @@ -1,18 +1,7 @@ """Load PyTorch Lightning Loggers.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/anomalib/utils/loggers/base.py b/anomalib/utils/loggers/base.py index c515e374ba..7bbc756de0 100644 --- a/anomalib/utils/loggers/base.py +++ b/anomalib/utils/loggers/base.py @@ -1,18 +1,7 @@ """Base logger for image logging consistency across all loggers used in anomalib.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from abc import abstractmethod from typing import Any, Optional, Union diff --git a/anomalib/utils/loggers/tensorboard.py b/anomalib/utils/loggers/tensorboard.py index c46690a37c..bdf620b3fc 100644 --- a/anomalib/utils/loggers/tensorboard.py +++ b/anomalib/utils/loggers/tensorboard.py @@ -1,18 +1,7 @@ """Tensorboard logger with add image interface.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Any, Optional, Union diff --git a/anomalib/utils/loggers/wandb.py b/anomalib/utils/loggers/wandb.py index 41856c1e4e..416a3a5c15 100644 --- a/anomalib/utils/loggers/wandb.py +++ b/anomalib/utils/loggers/wandb.py @@ -1,18 +1,7 @@ """wandb logger with add image interface.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Any, List, Optional, Union diff --git a/anomalib/utils/metrics/__init__.py b/anomalib/utils/metrics/__init__.py index cd558ca9fc..57937d11ba 100644 --- a/anomalib/utils/metrics/__init__.py +++ b/anomalib/utils/metrics/__init__.py @@ -1,4 +1,8 @@ """Custom anomaly evaluation metrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + import importlib import warnings from typing import List, Optional, Tuple, Union diff --git a/anomalib/utils/metrics/adaptive_threshold.py b/anomalib/utils/metrics/adaptive_threshold.py index 37c85d68d1..e4bb5d9a81 100644 --- a/anomalib/utils/metrics/adaptive_threshold.py +++ b/anomalib/utils/metrics/adaptive_threshold.py @@ -1,4 +1,8 @@ """Implementation of Optimal F1 score based on TorchMetrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + import torch from torchmetrics import Metric, PrecisionRecallCurve diff --git a/anomalib/utils/metrics/anomaly_score_distribution.py b/anomalib/utils/metrics/anomaly_score_distribution.py index c2c324d652..eb1af5a905 100644 --- a/anomalib/utils/metrics/anomaly_score_distribution.py +++ b/anomalib/utils/metrics/anomaly_score_distribution.py @@ -1,4 +1,8 @@ """Module that computes the parameters of the normal data distribution of the training set.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional, Tuple import torch diff --git a/anomalib/utils/metrics/aupr.py b/anomalib/utils/metrics/aupr.py index 4366aa88cf..f567444b10 100644 --- a/anomalib/utils/metrics/aupr.py +++ b/anomalib/utils/metrics/aupr.py @@ -1,4 +1,8 @@ """Implementation of AUROC metric based on TorchMetrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from typing import Tuple import torch diff --git a/anomalib/utils/metrics/aupro.py b/anomalib/utils/metrics/aupro.py index 11a66f6c82..f973efe0eb 100644 --- a/anomalib/utils/metrics/aupro.py +++ b/anomalib/utils/metrics/aupro.py @@ -1,4 +1,8 @@ """Implementation of AUPRO score based on TorchMetrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from typing import Any, Callable, List, Optional, Tuple import torch diff --git a/anomalib/utils/metrics/auroc.py b/anomalib/utils/metrics/auroc.py index 861bb9a3bf..60889d6be9 100644 --- a/anomalib/utils/metrics/auroc.py +++ b/anomalib/utils/metrics/auroc.py @@ -1,4 +1,8 @@ """Implementation of AUROC metric based on TorchMetrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from typing import Tuple import torch diff --git a/anomalib/utils/metrics/collection.py b/anomalib/utils/metrics/collection.py index 911b3a7654..ecf2aa779f 100644 --- a/anomalib/utils/metrics/collection.py +++ b/anomalib/utils/metrics/collection.py @@ -1,18 +1,7 @@ """Anomalib Metric Collection.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from torchmetrics import MetricCollection diff --git a/anomalib/utils/metrics/min_max.py b/anomalib/utils/metrics/min_max.py index 9def695626..d7d0126824 100644 --- a/anomalib/utils/metrics/min_max.py +++ b/anomalib/utils/metrics/min_max.py @@ -1,18 +1,7 @@ """Module that tracks the min and max values of the observations in each batch.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Tuple diff --git a/anomalib/utils/metrics/optimal_f1.py b/anomalib/utils/metrics/optimal_f1.py index 44f194a770..86205dc11d 100644 --- a/anomalib/utils/metrics/optimal_f1.py +++ b/anomalib/utils/metrics/optimal_f1.py @@ -1,4 +1,8 @@ """Implementation of Optimal F1 score based on TorchMetrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + import torch from torchmetrics import Metric, PrecisionRecallCurve diff --git a/anomalib/utils/metrics/plotting_utils.py b/anomalib/utils/metrics/plotting_utils.py index 37ca415741..7162c55808 100644 --- a/anomalib/utils/metrics/plotting_utils.py +++ b/anomalib/utils/metrics/plotting_utils.py @@ -1,4 +1,8 @@ """Helper functions to generate ROC-style plots of various metrics.""" + +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from typing import Tuple import torch diff --git a/anomalib/utils/sweep/__init__.py b/anomalib/utils/sweep/__init__.py index 46744f3583..12dc59d939 100644 --- a/anomalib/utils/sweep/__init__.py +++ b/anomalib/utils/sweep/__init__.py @@ -1,18 +1,7 @@ """Utils for Benchmarking and Sweep.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .config import flatten_sweep_params, get_run_config, set_in_nested_config from .helpers import ( diff --git a/anomalib/utils/sweep/config.py b/anomalib/utils/sweep/config.py index 96238f44c3..d491a661e2 100644 --- a/anomalib/utils/sweep/config.py +++ b/anomalib/utils/sweep/config.py @@ -1,18 +1,7 @@ """Utilities for modifying the configuration.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import itertools import operator diff --git a/anomalib/utils/sweep/helpers/__init__.py b/anomalib/utils/sweep/helpers/__init__.py index 05f42fd513..b970b59be7 100644 --- a/anomalib/utils/sweep/helpers/__init__.py +++ b/anomalib/utils/sweep/helpers/__init__.py @@ -1,18 +1,7 @@ """Helpers for benchmarking and hyperparameter optimization.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .callbacks import get_sweep_callbacks from .inference import get_meta_data, get_openvino_throughput, get_torch_throughput diff --git a/anomalib/utils/sweep/helpers/callbacks.py b/anomalib/utils/sweep/helpers/callbacks.py index 576d1dd17a..d4cf90676e 100644 --- a/anomalib/utils/sweep/helpers/callbacks.py +++ b/anomalib/utils/sweep/helpers/callbacks.py @@ -1,18 +1,7 @@ """Get callbacks related to sweep.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List, Union diff --git a/anomalib/utils/sweep/helpers/inference.py b/anomalib/utils/sweep/helpers/inference.py index b435d2ccd2..5a6e84c6c8 100644 --- a/anomalib/utils/sweep/helpers/inference.py +++ b/anomalib/utils/sweep/helpers/inference.py @@ -1,18 +1,7 @@ """Utils to help compute inference statistics.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import time from pathlib import Path diff --git a/docs/source/conf.py b/docs/source/conf.py index a7873e6e0f..c99faa0e75 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,19 +11,8 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import os import sys diff --git a/setup.py b/setup.py index b466accef5..881015130c 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,8 @@ """Setup file for anomalib.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from importlib.util import module_from_spec, spec_from_file_location from pathlib import Path from typing import List diff --git a/tests/__init__.py b/tests/__init__.py index 756ffd04c9..9c87d68684 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,15 +1,4 @@ """Tests.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/helpers/inference.py b/tests/helpers/inference.py index 90701f0576..1062ef514b 100644 --- a/tests/helpers/inference.py +++ b/tests/helpers/inference.py @@ -1,18 +1,7 @@ """Utilities to help tests inferencers""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Iterable, List, Tuple diff --git a/tests/helpers/model.py b/tests/helpers/model.py index 35866f3765..3345e9266e 100644 --- a/tests/helpers/model.py +++ b/tests/helpers/model.py @@ -1,18 +1,7 @@ """Common helpers for both nightly and pre-merge model tests.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import os from typing import Dict, List, Optional, Tuple, Union diff --git a/tests/nightly/models/test_model_nightly.py b/tests/nightly/models/test_model_nightly.py index 41807bc466..ac6b39006d 100644 --- a/tests/nightly/models/test_model_nightly.py +++ b/tests/nightly/models/test_model_nightly.py @@ -1,18 +1,7 @@ """Test Models on all MVTec AD Categories.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import itertools import math diff --git a/tests/pre_merge/__init__.py b/tests/pre_merge/__init__.py index da49853df6..2b9e7ddb40 100644 --- a/tests/pre_merge/__init__.py +++ b/tests/pre_merge/__init__.py @@ -1,15 +1,4 @@ """Pre-merge tests.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/config/__init__.py b/tests/pre_merge/config/__init__.py index 8d05a0bcff..545ce24e5b 100644 --- a/tests/pre_merge/config/__init__.py +++ b/tests/pre_merge/config/__init__.py @@ -1,15 +1,4 @@ """Test callbacks.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/config/test_config.py b/tests/pre_merge/config/test_config.py index 6d5cf57069..9d97ec689b 100644 --- a/tests/pre_merge/config/test_config.py +++ b/tests/pre_merge/config/test_config.py @@ -1,18 +1,7 @@ """Test Config Getter.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/tests/pre_merge/datasets/__init__.py b/tests/pre_merge/datasets/__init__.py index 1d3fed93f9..6d77f8653d 100644 --- a/tests/pre_merge/datasets/__init__.py +++ b/tests/pre_merge/datasets/__init__.py @@ -1,15 +1,4 @@ """Test dataset, tiler and transforms.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/deploy/test_inferencer.py b/tests/pre_merge/deploy/test_inferencer.py index 3f859ed97c..b33027afc6 100644 --- a/tests/pre_merge/deploy/test_inferencer.py +++ b/tests/pre_merge/deploy/test_inferencer.py @@ -1,18 +1,7 @@ """Tests for Torch and OpenVINO inferencers.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from tempfile import TemporaryDirectory diff --git a/tests/pre_merge/models/__init__.py b/tests/pre_merge/models/__init__.py index 2f80c33af4..b633577bb9 100644 --- a/tests/pre_merge/models/__init__.py +++ b/tests/pre_merge/models/__init__.py @@ -1,15 +1,4 @@ """Pre-merge model tests.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/models/test_model_premerge.py b/tests/pre_merge/models/test_model_premerge.py index 487d90abbd..4ac84b7350 100644 --- a/tests/pre_merge/models/test_model_premerge.py +++ b/tests/pre_merge/models/test_model_premerge.py @@ -1,18 +1,7 @@ """Quick sanity check on models.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import tempfile diff --git a/tests/pre_merge/post_processing/__init__.py b/tests/pre_merge/post_processing/__init__.py index 4895d29025..35e4f56c27 100644 --- a/tests/pre_merge/post_processing/__init__.py +++ b/tests/pre_merge/post_processing/__init__.py @@ -1,15 +1,4 @@ """Post-processing tests.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/post_processing/test_visualizer.py b/tests/pre_merge/post_processing/test_visualizer.py index a22f88323a..b3ed7168e8 100644 --- a/tests/pre_merge/post_processing/test_visualizer.py +++ b/tests/pre_merge/post_processing/test_visualizer.py @@ -1,18 +1,7 @@ """Tests for the Visualizer class.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import tempfile diff --git a/tests/pre_merge/utils/callbacks/__init__.py b/tests/pre_merge/utils/callbacks/__init__.py index 8d05a0bcff..545ce24e5b 100644 --- a/tests/pre_merge/utils/callbacks/__init__.py +++ b/tests/pre_merge/utils/callbacks/__init__.py @@ -1,15 +1,4 @@ """Test callbacks.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/utils/loggers/__init__.py b/tests/pre_merge/utils/loggers/__init__.py index 23adccdc4b..a37081ae1d 100644 --- a/tests/pre_merge/utils/loggers/__init__.py +++ b/tests/pre_merge/utils/loggers/__init__.py @@ -1,15 +1,4 @@ """Test supported loggers.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/utils/loggers/test_get_logger.py b/tests/pre_merge/utils/loggers/test_get_logger.py index 09a1c7581c..f3c239aec6 100644 --- a/tests/pre_merge/utils/loggers/test_get_logger.py +++ b/tests/pre_merge/utils/loggers/test_get_logger.py @@ -1,18 +1,7 @@ """Tests to ascertain requested logger.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from unittest.mock import patch diff --git a/tests/pre_merge/utils/metrics/__init__.py b/tests/pre_merge/utils/metrics/__init__.py index 7154d5f958..6b0e0edda5 100644 --- a/tests/pre_merge/utils/metrics/__init__.py +++ b/tests/pre_merge/utils/metrics/__init__.py @@ -1,13 +1,2 @@ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/tests/pre_merge/utils/metrics/test_adaptive_threshold.py b/tests/pre_merge/utils/metrics/test_adaptive_threshold.py index 8fd02cd04b..1a7eef5b61 100644 --- a/tests/pre_merge/utils/metrics/test_adaptive_threshold.py +++ b/tests/pre_merge/utils/metrics/test_adaptive_threshold.py @@ -1,18 +1,7 @@ """Tests for the adaptive threshold metric.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import random import pytest diff --git a/tests/pre_merge/utils/test_config.py b/tests/pre_merge/utils/test_config.py index 6d5cf57069..9d97ec689b 100644 --- a/tests/pre_merge/utils/test_config.py +++ b/tests/pre_merge/utils/test_config.py @@ -1,18 +1,7 @@ """Test Config Getter.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/tools/benchmarking/benchmark.py b/tools/benchmarking/benchmark.py index 244be2cab9..9f2e7c5869 100644 --- a/tools/benchmarking/benchmark.py +++ b/tools/benchmarking/benchmark.py @@ -1,19 +1,7 @@ """Benchmark all the algorithms in the repo.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. - +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import functools import io diff --git a/tools/benchmarking/utils/__init__.py b/tools/benchmarking/utils/__init__.py index 2f2c54b428..32cdd3840a 100644 --- a/tools/benchmarking/utils/__init__.py +++ b/tools/benchmarking/utils/__init__.py @@ -1,18 +1,7 @@ """Utils specific to running benchmarking scripts.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .convert import convert_to_openvino from .metrics import upload_to_wandb, write_metrics diff --git a/tools/benchmarking/utils/convert.py b/tools/benchmarking/utils/convert.py index 70c64023be..032e87dc89 100644 --- a/tools/benchmarking/utils/convert.py +++ b/tools/benchmarking/utils/convert.py @@ -1,18 +1,7 @@ """Model converters.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import List, Union diff --git a/tools/benchmarking/utils/metrics.py b/tools/benchmarking/utils/metrics.py index 2cece6d149..f61ecc1635 100644 --- a/tools/benchmarking/utils/metrics.py +++ b/tools/benchmarking/utils/metrics.py @@ -1,18 +1,8 @@ """Methods to compute and save metrics.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + import random import string from glob import glob diff --git a/tools/hpo/sweep.py b/tools/hpo/sweep.py index 7b0111ac5b..73d65efc7d 100644 --- a/tools/hpo/sweep.py +++ b/tools/hpo/sweep.py @@ -1,18 +1,7 @@ """Run wandb sweep.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from argparse import ArgumentParser from pathlib import Path diff --git a/tools/hpo/utils/__init__.py b/tools/hpo/utils/__init__.py index e8aaa2ddf1..dd10e8ac48 100644 --- a/tools/hpo/utils/__init__.py +++ b/tools/hpo/utils/__init__.py @@ -1,18 +1,7 @@ """Utils to help in HPO search.""" -# Copyright (C) 2021 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from .config import flatten_hpo_params diff --git a/tools/hpo/utils/config.py b/tools/hpo/utils/config.py index 63d1eb76ba..b01a831e4f 100644 --- a/tools/hpo/utils/config.py +++ b/tools/hpo/utils/config.py @@ -1,18 +1,7 @@ """Utils to update configuration files.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from typing import List diff --git a/tools/inference/gradio_inference.py b/tools/inference/gradio_inference.py index a7f93ec98c..3fd670bce1 100644 --- a/tools/inference/gradio_inference.py +++ b/tools/inference/gradio_inference.py @@ -3,6 +3,9 @@ This script provide a gradio web interface """ +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + from argparse import ArgumentParser, Namespace from importlib import import_module from pathlib import Path diff --git a/tools/test.py b/tools/test.py index 27befbcca9..5427cf9f06 100644 --- a/tools/test.py +++ b/tools/test.py @@ -1,18 +1,7 @@ """Test This script performs inference on the test dataset and saves the output visualizations into a directory.""" -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 from argparse import ArgumentParser, Namespace diff --git a/tools/train.py b/tools/train.py index 4749af6952..0e5daa3b10 100644 --- a/tools/train.py +++ b/tools/train.py @@ -5,19 +5,8 @@ results. """ -# Copyright (C) 2020 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions -# and limitations under the License. +# Copyright (C) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 import logging import warnings