def predict(self, image: str | Path | np.ndarray | PILImage | torch.Tensor) -> NumpyImageBatch:
        """Run inference on an input image.

        Args:
            image (str | Path | np.ndarray | PILImage | torch.Tensor): Input image as file path or array.

        Returns:
            NumpyImageBatch: Batch containing the predictions.

        Raises:
            TypeError: If image input is invalid type.
        """
        # Convert file path or string to image if necessary
        if isinstance(image, str | Path):
            image = read_image(image, as_tensor=False)
        elif isinstance(image, PILImage):
            image = np.array(image) / 255.0
        elif isinstance(image, torch.Tensor):
            image = image.cpu().numpy()

        image = self.pre_process(image)
        predictions = self.model({self.input_blob.any_name: image})
        pred_dict = self.post_process(predictions)

        return NumpyImageBatch(image=image, **pred_dict)
Run inference on an input image.

        Args:
            image (str | Path | np.ndarray | PILImage | torch.Tensor): Input image as file path or array.

        Returns:
            NumpyImageBatch: Batch containing the predictions.

        Raises:
            TypeError: If image input is invalid type.
        
src/anomalib/deploy/inferencers/openvino_inferencer.py