class_docstr: Args:
      min_subgraph_size (int): number of tensorRT graphs.
      use_gpu (bool): whether use gpu
      threshold (float): threshold to reserve the result for output.
class_docstr_tok: ["Args",":","min_subgraph_size","(","int",")",":","number","of","tensorRT","graphs",".","use_gpu","(","bool",")",":","whether","use","gpu","threshold","(","float",")",":","threshold","to","reserve","the","result","for","output","."]
docstr: Args:
      image (str/np.ndarray): path of image/ np.ndarray read by cv2
      threshold (float): threshold of predicted box' score
  Returns:
      results (dict): include 'boxes': np.ndarray: shape:[N,6], N: number of box,
                      matix element:[class, score, x_min, y_min, x_max, y_max]
                      MaskRCNN's results include 'masks': np.ndarray:
                      shape:[N, class_num, mask_resolution, mask_resolution]
docstr_tok: ["Args",":","image","(","str\/np.ndarray",")",":","path","of","image\/","np.ndarray","read","by","cv2","threshold","(","float",")",":","threshold","of","predicted","box","'","score","Returns",":","results","(","dict",")",":","include","'boxes","'",":","np.ndarray",":","shape",":","[","N,6","]",",","N",":","number","of","box",",","matix","element",":","[","class",",","score",",","x_min",",","y_min",",","x_max",",","y_max","]","MaskRCNN","'s","results","include","'masks","'",":","np.ndarray",":","shape",":","[","N",",","class_num",",","mask_resolution",",","mask_resolution","]"]
code: def predict(
      self, image: Union[str, np.ndarray], threshold: float = 0.5
  ):
      """
      Args:
          image (str/np.ndarray): path of image/ np.ndarray read by cv2
          threshold (float): threshold of predicted box' score
      Returns:
          results (dict): include 'boxes': np.ndarray: shape:[N,6], N: number of box,
                          matix element:[class, score, x_min, y_min, x_max, y_max]
                          MaskRCNN's results include 'masks': np.ndarray:
                          shape:[N, class_num, mask_resolution, mask_resolution]
      """
      inputs, im_info = self.transform(image)
      np_boxes, np_masks = None, None
  
      input_names = self.predictor.get_input_names()
      for i in range(len(input_names)):
          input_tensor = self.predictor.get_input_handle(input_names[i])
          input_tensor.copy_from_cpu(inputs[input_names[i]])
  
      self.predictor.run()
      output_names = self.predictor.get_output_names()
      boxes_tensor = self.predictor.get_output_handle(output_names[0])
      np_boxes = boxes_tensor.copy_to_cpu()
      # do not perform postprocess in benchmark mode
      results = []
      if reduce(lambda x, y: x * y, np_boxes.shape) < 6:
          print("[WARNNING] No object detected.")
          results = {"boxes": np.array([])}
      else:
          results = self.postprocess(
              np_boxes, np_masks, im_info, threshold=threshold
          )
      return results
  
imports: import base64
  import os
  import time
  from functools import reduce
  from typing import Union
  import numpy
  import solov2.data_feed
  import solov2.processor
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import serving
label_desc: Use image node_id 4 for calling the Detector obj's underlying member method code with example usage: obj.predict(image, threshold) and returns: results