def postprocess_detctions(refine_bbox_pred, refine_cls_prob, refine_angle_prob, anchors, is_training, gpu_id):
    boxes_pred = bbox_transform.rbbox_transform_inv(boxes=anchors, deltas=refine_bbox_pred, scale_factors=cfgs.ANCHOR_SCALE_FACTORS)
    angle_cls = tf.cast(tf.argmax(refine_angle_prob, axis=1), tf.float32)
    angle_cls = (((tf.reshape(angle_cls, [(- 1)]) * (- 1)) - 0.5) * cfgs.OMEGA)
    (x, y, w, h, theta) = tf.unstack(boxes_pred, axis=1)
    boxes_pred_angle = tf.transpose(tf.stack([x, y, w, h, angle_cls]))
    return_boxes_pred = []
    return_boxes_pred_angle = []
    return_scores = []
    return_labels = []
    for j in range(0, cfgs.CLASS_NUM):
        indices = filter_detections(boxes_pred_angle, refine_cls_prob[:, j], is_training, gpu_id)
        tmp_boxes_pred_angle = tf.reshape(tf.gather(boxes_pred_angle, indices), [(- 1), 5])
        tmp_boxes_pred = tf.reshape(tf.gather(boxes_pred, indices), [(- 1), 5])
        tmp_scores = tf.reshape(tf.gather(refine_cls_prob[:, j], indices), [(- 1)])
        if (cfgs.ANGLE_RANGE == 180):
            tmp_boxes_pred_angle = tf.py_func(coordinate_present_convert, inp=[tmp_boxes_pred_angle, 1], Tout=[tf.float32])
            tmp_boxes_pred_angle = tf.reshape(tmp_boxes_pred_angle, [(- 1), 5])
            tmp_boxes_pred = tf.py_func(coordinate_present_convert, inp=[tmp_boxes_pred, 1], Tout=[tf.float32])
            tmp_boxes_pred = tf.reshape(tmp_boxes_pred, [(- 1), 5])
        return_boxes_pred.append(tmp_boxes_pred)
        return_boxes_pred_angle.append(tmp_boxes_pred_angle)
        return_scores.append(tmp_scores)
        return_labels.append((tf.ones_like(tmp_scores) * (j + 1)))
    return_boxes_pred = tf.concat(return_boxes_pred, axis=0)
    return_boxes_pred_angle = tf.concat(return_boxes_pred_angle, axis=0)
    return_scores = tf.concat(return_scores, axis=0)
    return_labels = tf.concat(return_labels, axis=0)
    return (return_boxes_pred, return_scores, return_labels, return_boxes_pred_angle)
def postprocess_detctions(refine_bbox_pred, refine_cls_prob, refine_angle_prob, anchors, is_training, gpu_id):
    boxes_pred = bbox_transform.rbbox_transform_inv(boxes=anchors, deltas=refine_bbox_pred, scale_factors=cfgs.ANCHOR_SCALE_FACTORS)
    angle_cls = tf.cast(tf.argmax(refine_angle_prob, axis=1), tf.float32)
    angle_cls = (((tf.reshape(angle_cls, [(- 1)]) * (- 1)) - 0.5) * cfgs.OMEGA)
    (x, y, w, h, theta) = tf.unstack(boxes_pred, axis=1)
    boxes_pred_angle = tf.transpose(tf.stack([x, y, w, h, angle_cls]))
    return_boxes_pred = []
    return_boxes_pred_angle = []
    return_scores = []
    return_labels = []
    for j in range(0, cfgs.CLASS_NUM):
        indices = filter_detections(boxes_pred_angle, refine_cls_prob[:, j], is_training, gpu_id)
        tmp_boxes_pred_angle = tf.reshape(tf.gather(boxes_pred_angle, indices), [(- 1), 5])
        tmp_boxes_pred = tf.reshape(tf.gather(boxes_pred, indices), [(- 1), 5])
        tmp_scores = tf.reshape(tf.gather(refine_cls_prob[:, j], indices), [(- 1)])
        if (cfgs.ANGLE_RANGE == 180):
            tmp_boxes_pred_angle = tf.py_func(coordinate_present_convert, inp=[tmp_boxes_pred_angle, 1], Tout=[tf.float32])
            tmp_boxes_pred_angle = tf.reshape(tmp_boxes_pred_angle, [(- 1), 5])
            tmp_boxes_pred = tf.py_func(coordinate_present_convert, inp=[tmp_boxes_pred, 1], Tout=[tf.float32])
            tmp_boxes_pred = tf.reshape(tmp_boxes_pred, [(- 1), 5])
        return_boxes_pred.append(tmp_boxes_pred)
        return_boxes_pred_angle.append(tmp_boxes_pred_angle)
        return_scores.append(tmp_scores)
        return_labels.append((tf.ones_like(tmp_scores) * (j + 1)))
    return_boxes_pred = tf.concat(return_boxes_pred, axis=0)
    return_boxes_pred_angle = tf.concat(return_boxes_pred_angle, axis=0)
    return_scores = tf.concat(return_scores, axis=0)
    return_labels = tf.concat(return_labels, axis=0)
    return (return_boxes_pred, return_scores, return_labels, return_boxes_pred_angle)