docstr: Calculate total score of each bounding box
  
  Parameters
  ----------
  hmap : torch.tensor
      Probability heatmap tensor.
  box_ : list
      Rectanguar bounding box.
  
  Returns
  -------
  float
      Confidence score.
docstr_tok: ["Calculate","total","score","of","each","bounding","box","Parameters","--","--","--","--","--","hmap",":","torch.tensor","Probability","heatmap","tensor",".","box_",":","list","Rectanguar","bounding","box",".","Returns","--","--","--","-","float","Confidence","score","."]
code: def box_score_fast(self, hmap, box_):
      """
      Calculate total score of each bounding box
  
      Parameters
      ----------
      hmap : torch.tensor
          Probability heatmap tensor.
      box_ : list
          Rectanguar bounding box.
  
      Returns
      -------
      float
          Confidence score.
      """
      h, w = hmap.shape[:2]
      box = box_.copy()
      xmin = np.clip(
          np.floor(box[:, 0].min()).astype(np.int32), 0, w - 1
      )
      xmax = np.clip(
          np.ceil(box[:, 0].max()).astype(np.int32), 0, w - 1
      )
      ymin = np.clip(
          np.floor(box[:, 1].min()).astype(np.int32), 0, h - 1
      )
      ymax = np.clip(
          np.ceil(box[:, 1].max()).astype(np.int32), 0, h - 1
      )
  
      mask = np.zeros(
          (ymax - ymin + 1, xmax - xmin + 1), dtype=np.uint8
      )
      box[:, 0] = box[:, 0] - xmin
      box[:, 1] = box[:, 1] - ymin
      cv2.fillPoly(mask, box.reshape(1, -1, 2).astype(np.int32), 1)
  
      return cv2.mean(hmap[ymin : ymax + 1, xmin : xmax + 1], mask)[0]
  
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 18 for calling the DBNet obj's underlying member method code with example usage: obj.box_score_fast(hmap, box_) and returns: cv2