Skip to content

Make OpenVINO fully optional in Anomalib #2719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/anomalib/deploy/inferencers/openvino_inferencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down Expand Up @@ -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:
Expand Down
Loading