def parse_output(thr_id, res, frame):
    for (batch, data) in enumerate(res):
        pred = data[0]
        for values in enumerate(pred):
            index = values[0]
            l_pred = values[1]
            img_id = l_pred[0]
            label = l_pred[1]
            conf = l_pred[2]
            x_min = l_pred[3]
            y_min = l_pred[4]
            x_max = l_pred[5]
            y_max = l_pred[6]
            if (label > 4):
                label = 4
            if ((img_id != (- 1)) and (conf >= CONFIDENCE_THRESHOLD)):
                (height, width) = frame.shape[:2]
                cv2.rectangle(frame, (int((width * x_min)), int((height * y_min))), (int((width * x_max)), int((height * y_max))), COLORS[int(label)], 2)
                cv2.putText(frame, str(CLASSES[int(label)]), ((int((width * x_min)) - 10), (int((height * y_min)) - 10)), cv2.FONT_HERSHEY_SIMPLEX, 0.5, COLORS[int(label)], 2)
    return frame
def parse_output(thr_id, res, frame):
    for (batch, data) in enumerate(res):
        pred = data[0]
        for values in enumerate(pred):
            index = values[0]
            l_pred = values[1]
            img_id = l_pred[0]
            label = l_pred[1]
            conf = l_pred[2]
            x_min = l_pred[3]
            y_min = l_pred[4]
            x_max = l_pred[5]
            y_max = l_pred[6]
            if (label > 4):
                label = 4
            if ((img_id != (- 1)) and (conf >= CONFIDENCE_THRESHOLD)):
                (height, width) = frame.shape[:2]
                cv2.rectangle(frame, (int((width * x_min)), int((height * y_min))), (int((width * x_max)), int((height * y_max))), COLORS[int(label)], 2)
                cv2.putText(frame, str(CLASSES[int(label)]), ((int((width * x_min)) - 10), (int((height * y_min)) - 10)), cv2.FONT_HERSHEY_SIMPLEX, 0.5, COLORS[int(label)], 2)
    return frame