(predictions, localizations,
                     select_threshold=None,
                     num_classes=21,
                     scope=None)
Extract classes, scores and bounding boxes from network output layers.
    Batch-compatible: inputs are supposed to have batch-type shapes.

    Args:
      predictions: List of SSD prediction layers;
      localizations: List of localization layers;
      select_threshold: Classification threshold for selecting a box. All boxes
        under the threshold are set to 'zero'. If None, no threshold applied.
    Return:
      d_scores, d_bboxes: Dictionary of scores and bboxes Tensors of
        size Batches X N x 1 | 4. Each key corresponding to a class.
Extract classes, scores and bounding boxes from network output layers.
    Batch-compatible: inputs are supposed to have batch-type shapes.
Extract classes scores and bounding boxes from network output layers . Batch - compatible : inputs are supposed to have batch - type shapes .
def tf_bboxes_select(predictions, localizations,
                     select_threshold=None,
                     num_classes=21,
                     scope=None):
    """Extract classes, scores and bounding boxes from network output layers.
    Batch-compatible: inputs are supposed to have batch-type shapes.

    Args:
      predictions: List of SSD prediction layers;
      localizations: List of localization layers;
      select_threshold: Classification threshold for selecting a box. All boxes
        under the threshold are set to 'zero'. If None, no threshold applied.
    Return:
      d_scores, d_bboxes: Dictionary of scores and bboxes Tensors of
        size Batches X N x 1 | 4. Each key corresponding to a class.
    """
    with tf.name_scope(scope, 'bboxes_select',
                       [predictions, localizations]):
        l_scores = []
        l_bboxes = []
        for i in range(len(predictions)):
            scores, bboxes = tf_bboxes_select_layer(predictions[i],
                                                    localizations[i],
                                                    select_threshold,
                                                    num_classes)
            l_scores.append(scores)
            l_bboxes.append(bboxes)
        # Concat results.
        d_scores = {}
        d_bboxes = {}
        for c in l_scores[0].keys():
            ls = [s[c] for s in l_scores]
            lb = [b[c] for b in l_bboxes]
            d_scores[c] = tf.concat(ls, axis=1)
            d_bboxes[c] = tf.concat(lb, axis=1)
        return d_scores, d_bboxes
def tf_bboxes_select ( predictions , localizations , select_threshold = None , num_classes = 21 , scope = None ) : with tf . name_scope ( scope , 'bboxes_select' , [ predictions , localizations ] ) : l_scores = [ ] l_bboxes = [ ] for i in range ( len ( predictions ) ) : scores , bboxes = tf_bboxes_select_layer ( predictions [ i ] , localizations [ i ] , select_threshold , num_classes ) l_scores . append ( scores ) l_bboxes . append ( bboxes ) # Concat results. d_scores = { } d_bboxes = { } for c in l_scores [ 0 ] . keys ( ) : ls = [ s [ c ] for s in l_scores ] lb = [ b [ c ] for b in l_bboxes ] d_scores [ c ] = tf . concat ( ls , axis = 1 ) d_bboxes [ c ] = tf . concat ( lb , axis = 1 ) return d_scores , d_bboxes