code: def detect(net, meta, image, thresh=0.5, hier_thresh=0.5, nms=0.45):
      im = load_image(image, 0, 0)
      num = c_int(0)
      pnum = pointer(num)
      predict_image(net, im)
      dets = get_network_boxes(
          net, im.w, im.h, thresh, hier_thresh, None, 0, pnum
      )
      num = pnum[0]
      if nms:
          do_nms_obj(dets, num, meta.classes, nms)
  
      res = []
      for j in range(num):
          for i in range(meta.classes):
              if dets[j].prob[i] > 0:
                  b = dets[j].bbox
                  res.append(
                      (
                          meta.names[i],
                          dets[j].prob[i],
                          (b.x, b.y, b.w, b.h),
                      )
                  )
      res = sorted(res, key=lambda x: -x[1])
      free_image(im)
      free_detections(dets, num)
      return res
  
file_path: MMdnn/mmdnn/conversion/examples/darknet/darknet.py
imports: from ctypes import *
  import math
  import random
label_desc: Use image node_id 4 for calling a global function with example usage: detect(net, meta, image, thresh, hier_thresh, nms) and returns: res