class_docstr: Abstract class for the inference.
  
  This is used by both Torch and OpenVINO inference.
class_docstr_tok: ["Abstract","class","for","the","inference",".","This","is","used","by","both","Torch","and","OpenVINO","inference","."]
docstr: Superimpose segmentation mask on top of image.
  
  Args:
      metadata (dict): Metadata of the image which contains the image size.
      anomaly_map (np.ndarray): Anomaly map which is used to extract segmentation mask.
      image (np.ndarray): Image on which segmentation mask is to be superimposed.
  
  Returns:
      np.ndarray: Image with segmentation mask superimposed.
docstr_tok: ["Superimpose","segmentation","mask","on","top","of","image",".","Args",":","metadata","(","dict",")",":","Metadata","of","the","image","which","contains","the","image","size",".","anomaly_map","(","np.ndarray",")",":","Anomaly","map","which","is","used","to","extract","segmentation","mask",".","image","(","np.ndarray",")",":","Image","on","which","segmentation","mask","is","to","be","superimposed",".","Returns",":","np.ndarray",":","Image","with","segmentation","mask","superimposed","."]
code: def _superimpose_segmentation_mask(
      metadata: dict, anomaly_map: np.ndarray, image: np.ndarray
  ) -> np.ndarray:
      """Superimpose segmentation mask on top of image.
  
      Args:
          metadata (dict): Metadata of the image which contains the image size.
          anomaly_map (np.ndarray): Anomaly map which is used to extract segmentation mask.
          image (np.ndarray): Image on which segmentation mask is to be superimposed.
  
      Returns:
          np.ndarray: Image with segmentation mask superimposed.
      """
      pred_mask = compute_mask(
          anomaly_map, 0.5
      )  # assumes predictions are normalized.
      image_height = metadata["image_shape"][0]
      image_width = metadata["image_shape"][1]
      pred_mask = cv2.resize(pred_mask, (image_width, image_height))
      boundaries = find_boundaries(pred_mask)
      outlines = dilation(boundaries, np.ones((7, 7)))
      image[outlines] = [255, 0, 0]
      return image
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import Any, cast
  import cv2
  import numpy
  from omegaconf import DictConfig, OmegaConf
  from skimage.morphology import dilation
  from skimage.segmentation import find_boundaries
  from torch import Tensor
  from anomalib.data.utils import read_image
  from anomalib.post_processing import ImageResult, compute_mask
  from anomalib.post_processing.normalization.cdf import normalize
  from anomalib.post_processing.normalization.cdf import standardize
  from anomalib.post_processing.normalization.min_max import normalize
label_desc: Use image node_id 6 for calling the Inferencer obj's underlying member method code with example usage: obj._superimpose_segmentation_mask(metadata, anomaly_map, image) and returns: image