docstr: Load or convert input to OpenCV BGR image numpy array.
  
  Parameters
  ----------
  image : str, PIL.Image, or np.ndarray
      Image to load or convert.
  
  Raises
  ------
  FileNotFoundError
      Raised when the input is a path to file (str), but the file is not found.
  TypeError
      Raised when the data type of the input is not supported.
  
  Returns
  -------
  image : np.ndarray
      OpenCV BGR image.
docstr_tok: ["Load","or","convert","input","to","OpenCV","BGR","image","numpy","array",".","Parameters","--","--","--","--","--","image",":","str",",","PIL.Image",",","or","np.ndarray","Image","to","load","or","convert",".","Raises","--","--","--","FileNotFoundError","Raised","when","the","input","is","a","path","to","file","(","str",")",",","but","the","file","is","not","found",".","TypeError","Raised","when","the","data","type","of","the","input","is","not","supported",".","Returns","--","--","--","-","image",":","np.ndarray","OpenCV","BGR","image","."]
code: def get_cv2_image(self, image):
      """
      Load or convert input to OpenCV BGR image numpy array.
  
      Parameters
      ----------
      image : str, PIL.Image, or np.ndarray
          Image to load or convert.
  
      Raises
      ------
      FileNotFoundError
          Raised when the input is a path to file (str), but the file is not found.
      TypeError
          Raised when the data type of the input is not supported.
  
      Returns
      -------
      image : np.ndarray
          OpenCV BGR image.
      """
      if isinstance(image, str):
          if os.path.isfile(image):
              image = cv2.imread(image, cv2.IMREAD_COLOR).astype(
                  "float32"
              )
          else:
              raise FileNotFoundError("Cannot find {}".format(image))
      elif isinstance(image, np.ndarray):
          image = image.astype("float32")
      elif isinstance(image, PIL.Image.Image):
          image = np.asarray(image)[:, :, ::-1]
      else:
          raise TypeError(
              "Unsupport image format. Only path-to-file, opencv BGR image, and PIL image are supported."
          )
  
      return image
  
imports: import os
  import math
  import yaml
  from shapely.geometry import Polygon
  import PIL.Image
  import numpy
  import cv2
  import pyclipper
  import torch
  from .model.constructor import Configurable
label_desc: Use image node_id 6 for calling the DBNet obj's underlying member method code with example usage: obj.get_cv2_image(image) and returns: image