jrieke / shape-detection

🟣 Object detection of abstract shapes with neural networks
MIT License
218 stars 131 forks source link

dist wrong #2

Closed boldt closed 5 years ago

boldt commented 5 years ago

In the file `two-rectangles-or-triangles you have the following code:

        iou = IOU(pred_bboxes[:4], exp_bboxes[:4]) + IOU(pred_bboxes[4:], exp_bboxes[4:])
        iou_flipped = IOU(pred_bboxes[:4], flipped_exp_bboxes[:4]) + IOU(pred_bboxes[4:], flipped_exp_bboxes[4:])

        dist = IOU(pred_bboxes[:4], exp_bboxes[:4]) + IOU(pred_bboxes[4:], exp_bboxes[4:])
        dist_flipped = IOU(pred_bboxes[:4], flipped_exp_bboxes[:4]) + IOU(pred_bboxes[4:], flipped_exp_bboxes[4:])

        if mse_flipped < mse:  # using iou or dist here leads to similar results

Here, dist is calculated the same as iou, which is wrong!a

jrieke commented 5 years ago

Hey Dennis, thanks for spotting this; it's indeed wrong (even though it shouldn't affect training very much, as using the squared error or IOU as the distance metric is pretty similar). I updated it, let me know if there are any further issues!