def do_nms(boxes, nms_thresh):
    if (len(boxes) > 0):
        nb_class = len(boxes[0].classes)
    else:
        return
    for c in range(nb_class):
        sorted_indices = np.argsort([(- box.classes[c]) for box in boxes])
        for i in range(len(sorted_indices)):
            index_i = sorted_indices[i]
            if (boxes[index_i].classes[c] == 0):
                continue
            for j in range((i + 1), len(sorted_indices)):
                index_j = sorted_indices[j]
                if (bbox_iou(boxes[index_i], boxes[index_j]) >= nms_thresh):
                    boxes[index_j].classes[c] = 0
def do_nms(boxes, nms_thresh):
    if (len(boxes) > 0):
        nb_class = len(boxes[0].classes)
    else:
        return
    for c in range(nb_class):
        sorted_indices = np.argsort([(- box.classes[c]) for box in boxes])
        for i in range(len(sorted_indices)):
            index_i = sorted_indices[i]
            if (boxes[index_i].classes[c] == 0):
                continue
            for j in range((i + 1), len(sorted_indices)):
                index_j = sorted_indices[j]
                if (bbox_iou(boxes[index_i], boxes[index_j]) >= nms_thresh):
                    boxes[index_j].classes[c] = 0