diff --git a/anomalib/deploy/inferencers/openvino.py b/anomalib/deploy/inferencers/openvino.py index 52f50e98a5..df428c7e83 100644 --- a/anomalib/deploy/inferencers/openvino.py +++ b/anomalib/deploy/inferencers/openvino.py @@ -14,18 +14,21 @@ # See the License for the specific language governing permissions # and limitations under the License. +import importlib from pathlib import Path from typing import Dict, Optional, Tuple, Union import cv2 import numpy as np from omegaconf import DictConfig, ListConfig -from openvino.inference_engine import IECore # pylint: disable=no-name-in-module from anomalib.pre_processing import PreProcessor from .base import Inferencer +if importlib.util.find_spec("openvino") is not None: + from openvino.inference_engine import IECore # pylint: disable=no-name-in-module + class OpenVINOInferencer(Inferencer): """OpenVINO implementation for the inference. diff --git a/anomalib/models/padim/model.py b/anomalib/models/padim/model.py index cf371bb1a0..1d5544164b 100644 --- a/anomalib/models/padim/model.py +++ b/anomalib/models/padim/model.py @@ -23,7 +23,7 @@ import torch import torch.nn.functional as F import torchvision -from kornia import gaussian_blur2d +from kornia.filters import gaussian_blur2d from omegaconf import DictConfig, ListConfig from torch import Tensor, nn diff --git a/anomalib/models/patchcore/model.py b/anomalib/models/patchcore/model.py index 419f728926..5358c8c594 100644 --- a/anomalib/models/patchcore/model.py +++ b/anomalib/models/patchcore/model.py @@ -22,7 +22,7 @@ import torch import torch.nn.functional as F import torchvision -from kornia import gaussian_blur2d +from kornia.filters import gaussian_blur2d from omegaconf import ListConfig from torch import Tensor, nn diff --git a/requirements/base.txt b/requirements/base.txt index 0296a08193..929bcb7ba6 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,21 +1,11 @@ -albumentations==1.1.0 -attrdict==2.0.1 -defusedxml==0.7.1 -einops==0.3.2 -kornia==0.5.6 -lxml==4.6.5 -matplotlib==3.4.3 -networkx~=2.5 -numpy~=1.19.5 -omegaconf==2.1.1 +albumentations>=1.1.0 +einops>=0.3.2 +kornia>=0.5.6 +omegaconf>=2.1.1 opencv-python>=4.5.3.56 -opencv-contrib-python==4.5.5.62 -pandas~=1.1.5 -pillow==9.0.0 +pandas>=1.1.0 pytorch-lightning>=1.6.0 -torch==1.8.1 -torchvision==0.9.1 -torchtext==0.9.1 -scikit-image>=0.17.2 -scikit-learn==0.24.2 +torchvision>=0.9.1 +torchtext>=0.9.1 wandb==0.12.9 +matplotlib>=3.4.3