jrieke/shape-detection

dist wrong

Closed this issue · 1 comments

boldt commented

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

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!