code: def infer(
      image: np.ndarray, inferencer: Inferencer
  ) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
      """Inference function, return anomaly map, score, heat map, prediction mask ans visualisation.
  
      Args:
          image (np.ndarray): image to compute
          inferencer (Inferencer): model inferencer
  
      Returns:
          tuple[np.ndarray, float, np.ndarray, np.ndarray, np.ndarray]:
          heat_map, pred_mask, segmentation result.
      """
      # Perform inference for the given image.
      predictions = inferencer.predict(image=image)
      return (
          predictions.heat_map,
          predictions.pred_mask,
          predictions.segmentations,
      )
  
file_path: anomalib/tools/inference/gradio_inference.py
imports: from __future__ import annotations
  from argparse import ArgumentParser
  from importlib import import_module
  from pathlib import Path
  import gradio
  import gradio.inputs
  import gradio.outputs
  import numpy
  from anomalib.deploy import Inferencer
label_desc: Use image node_id 3 for calling a global function with example usage: infer(image, inferencer) and returns: predictions,  predictions,  predictions