code: def do_nms_sort(dets, classes, thresh):
      "Does the sorting based on the threshold values"
      k = len(dets) - 1
      cnt = 0
      while cnt < k:
          if dets[cnt]["objectness"] == 0:
              dets[k], dets[cnt] = dets[cnt], dets[k]
              k = k - 1
          else:
              cnt = cnt + 1
      total = k + 1
      for k in range(classes):
          for i in range(total):
              dets[i]["sort_class"] = k
          dets[0:total] = sorted(
              dets[0:total],
              key=cmp_to_key(nms_comparator),
              reverse=True,
          )
          for i in range(total):
              if dets[i]["prob"][k] == 0:
                  continue
              a = dets[i]["bbox"]
              for j in range(i + 1, total):
                  b = dets[j]["bbox"]
                  if _box_iou(a, b) > thresh:
                      dets[j]["prob"][k] = 0
  
imports: from __future__ import division
  import math
  from collections import namedtuple
  from functools import cmp_to_key
  import numpy
label_desc: Use image node_id 11 for calling a global function with example usage: do_nms_sort(dets, classes, thresh) without return types