class_docstr: Creates temporary XML files from masks for testing. Intended to be used
  as a context so that the XML files are automatically deleted when the
  execution goes out of scope.
  
  Example:
  
      >>> with BBFromMasks(root="/tmp/datasets/MVTec", datast_name="MVTec"):
      >>>     tests_case()
  
  Args:
      root (str, optional): Path to the dataset location. Defaults to "datasets/MVTec".
      dataset_name (str, optional): Name of the dataset to write to the XML file. Defaults to "MVTec".
code: def __init__(
      self, root: str = "datasets/MVTec", dataset_name: str = "MVTec"
  ) -> None:
      self.root = root
      self.dataset_name = dataset_name
      self.generated_xml_files: List[str] = []
  
file_path: anomalib/tests/helpers/detection.py
imports: import os
  import xml.etree.ElementTree
  from glob import glob
  from typing import List, Tuple
  import cv2
  import numpy
label_desc: Use image node_id 1 to create a new BBFromMasks object  with example: obj = BBFromMasks(root, dataset_name)