class_docstr: OpenVINO implementation for the inference.
  
  Args:
      path (str | Path): Path to the openvino onnx, xml or bin file.
      metadata (str | Path | dict, optional): Path to metadata file or a dict object defining the
          metadata. Defaults to None.
      device (str | None, optional): Device to run the inference on. Defaults to "CPU".
      task (TaskType | None, optional): Task type. Defaults to None.
class_docstr_tok: ["OpenVINO","implementation","for","the","inference",".","Args",":","path","(","str","|","Path",")",":","Path","to","the","openvino","onnx",",","xml","or","bin","file",".","metadata","(","str","|","Path","|","dict",",","optional",")",":","Path","to","metadata","file","or","a","dict","object","defining","the","metadata",".","Defaults","to","None",".","device","(","str","|","None",",","optional",")",":","Device","to","run","the","inference","on",".","Defaults","to","``","CPU","''",".","task","(","TaskType","|","None",",","optional",")",":","Task","type",".","Defaults","to","None","."]
docstr: Get bounding boxes from masks.
  
  Args:
      masks (np.ndarray): Input mask of shape (H, W)
  
  Returns:
      np.ndarray: array of shape (N, 4) containing the bounding box coordinates of the objects in the masks
      in xyxy format.
docstr_tok: ["Get","bounding","boxes","from","masks",".","Args",":","masks","(","np.ndarray",")",":","Input","mask","of","shape","(","H",",","W",")","Returns",":","np.ndarray",":","array","of","shape","(","N",",","4",")","containing","the","bounding","box","coordinates","of","the","objects","in","the","masks","in","xyxy","format","."]
code: def _get_boxes(mask: np.ndarray) -> np.ndarray:
      """Get bounding boxes from masks.
  
      Args:
          masks (np.ndarray): Input mask of shape (H, W)
  
      Returns:
          np.ndarray: array of shape (N, 4) containing the bounding box coordinates of the objects in the masks
          in xyxy format.
      """
      _, comps = cv2.connectedComponents(mask)
  
      labels = np.unique(comps)
      boxes = []
      for label in labels[labels != 0]:
          y_loc, x_loc = np.where(comps == label)
          boxes.append(
              [
                  np.min(x_loc),
                  np.min(y_loc),
                  np.max(x_loc),
                  np.max(y_loc),
              ]
          )
      boxes = np.stack(boxes) if boxes else np.empty((0, 4))
      return boxes
  
file_path: anomalib/src/anomalib/deploy/inferencers/openvino_inferencer.py
imports: from __future__ import annotations
  import logging
  from importlib.util import find_spec
  from pathlib import Path
  from typing import Any
  import albumentations
  import cv2
  import numpy
  from omegaconf import DictConfig
  from anomalib.data import TaskType
  from .base_inferencer import Inferencer
label_desc: Use image node_id 6 for calling the OpenVINOInferencer obj's underlying member method code with example usage: obj._get_boxes(mask) and returns: boxes