ChunML / ssd-tf2

A super clean implementation of SSD (Single Shot MultiBox Detector) made possible by Tensorflow 2.0
MIT License
115 stars 54 forks source link

Scores computation in test.py may be wrong #28

Open FSet89 opened 3 years ago

FSet89 commented 3 years ago

The variable scores in the predict function is never used and class scores are computed based on confs. Is that crrect?

def predict(imgs, default_boxes):
    confs, locs = ssd(imgs)

    confs = tf.squeeze(confs, 0)
    locs = tf.squeeze(locs, 0)

    confs = tf.math.softmax(confs, axis=-1)
    classes = tf.math.argmax(confs, axis=-1)
    scores = tf.math.reduce_max(confs, axis=-1) # never used

    boxes = decode(default_boxes, locs)

    out_boxes = []
    out_labels = []
    out_scores = []

    for c in range(1, NUM_CLASSES):
        cls_scores = confs[:, c] # correct?