def filter_detections(boxes, scores, is_training, gpu_id):
    '\n    :param boxes: [-1, 4]\n    :param scores: [-1, ]\n    :param labels: [-1, ]\n    :return:\n    '
    if is_training:
        indices = tf.reshape(tf.where(tf.greater(scores, cfgs.VIS_SCORE)), [(- 1)])
    else:
        indices = tf.reshape(tf.where(tf.greater(scores, cfgs.FILTERED_SCORE)), [(- 1)])
    if cfgs.NMS:
        filtered_boxes = tf.gather(boxes, indices)
        filtered_scores = tf.gather(scores, indices)
        if (cfgs.ANGLE_RANGE == 180):
            filtered_boxes = tf.py_func(coordinate_present_convert, inp=[filtered_boxes, 1], Tout=[tf.float32])
            filtered_boxes = tf.reshape(filtered_boxes, [(- 1), 5])
        max_output_size = (4000 if ('DOTA' in cfgs.NET_NAME) else 200)
        nms_indices = nms_rotate.nms_rotate(decode_boxes=filtered_boxes, scores=filtered_scores, iou_threshold=cfgs.NMS_IOU_THRESHOLD, max_output_size=(100 if is_training else max_output_size), use_angle_condition=False, angle_threshold=15, use_gpu=True, gpu_id=gpu_id)
        indices = tf.gather(indices, nms_indices)
    return indices
:param boxes: [-1, 4]
:param scores: [-1, ]
:param labels: [-1, ]
:return:
def filter_detections(boxes, scores, is_training, gpu_id):
    '\n    :param boxes: [-1, 4]\n    :param scores: [-1, ]\n    :param labels: [-1, ]\n    :return:\n    '
    if is_training:
        indices = tf.reshape(tf.where(tf.greater(scores, cfgs.VIS_SCORE)), [(- 1)])
    else:
        indices = tf.reshape(tf.where(tf.greater(scores, cfgs.FILTERED_SCORE)), [(- 1)])
    if cfgs.NMS:
        filtered_boxes = tf.gather(boxes, indices)
        filtered_scores = tf.gather(scores, indices)
        if (cfgs.ANGLE_RANGE == 180):
            filtered_boxes = tf.py_func(coordinate_present_convert, inp=[filtered_boxes, 1], Tout=[tf.float32])
            filtered_boxes = tf.reshape(filtered_boxes, [(- 1), 5])
        max_output_size = (4000 if ('DOTA' in cfgs.NET_NAME) else 200)
        nms_indices = nms_rotate.nms_rotate(decode_boxes=filtered_boxes, scores=filtered_scores, iou_threshold=cfgs.NMS_IOU_THRESHOLD, max_output_size=(100 if is_training else max_output_size), use_angle_condition=False, angle_threshold=15, use_gpu=True, gpu_id=gpu_id)
        indices = tf.gather(indices, nms_indices)
    return indices