diff --git a/src/anomalib/deploy/inferencers/openvino_inferencer.py b/src/anomalib/deploy/inferencers/openvino_inferencer.py index 1327efeb1e..aeac60b656 100644 --- a/src/anomalib/deploy/inferencers/openvino_inferencer.py +++ b/src/anomalib/deploy/inferencers/openvino_inferencer.py @@ -51,17 +51,19 @@ import logging from pathlib import Path -from typing import Any +from typing import TYPE_CHECKING, Any import numpy as np import torch from lightning_utilities.core.imports import module_available -from openvino.runtime.utils.data_helpers.wrappers import OVDict from PIL.Image import Image as PILImage from anomalib.data import NumpyImageBatch from anomalib.data.utils import read_image +if TYPE_CHECKING: + from openvino.runtime.utils.data_helpers.wrappers import OVDict + logger = logging.getLogger("anomalib") @@ -177,7 +179,7 @@ def pre_process(image: np.ndarray) -> np.ndarray: return image @staticmethod - def post_process(predictions: OVDict) -> dict: + def post_process(predictions: "OVDict") -> dict: """Convert OpenVINO predictions to dictionary. Args: