(boxes, scores, is_training)
return indices
:param boxes: [-1, 4]
    :param scores: [-1, ]
    :param labels: [-1, ]
    :return:
:param boxes: [-1, 4]
    :param scores: [-1, ]
    :param labels: [-1, ]
    :return:
: param boxes : [ - 1 4 ] : param scores : [ - 1 ] : param labels : [ - 1 ] : return :
def filter_detections(boxes, scores, is_training):
    """
    :param boxes: [-1, 4]
    :param scores: [-1, ]
    :param labels: [-1, ]
    :return:
    """
    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)

        # perform NMS

        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 1000,
                                            use_angle_condition=False,
                                            angle_threshold=15,
                                            use_gpu=False)

        # filter indices based on NMS
        indices = tf.gather(indices, nms_indices)

    # add indices to list of all indices
    return indices
def filter_detections ( boxes , scores , is_training ) : 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 ) # perform NMS 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 1000 , use_angle_condition = False , angle_threshold = 15 , use_gpu = False ) # filter indices based on NMS indices = tf . gather ( indices , nms_indices ) # add indices to list of all indices return indices