ayooshkathuria / YOLO_v3_tutorial_from_scratch

Accompanying code for Paperspace tutorial series "How to Implement YOLO v3 Object Detector from Scratch"
https://blog.paperspace.com/how-to-implement-a-yolo-object-detector-in-pytorch/
2.32k stars 724 forks source link

About IoU computation. #51

Closed bot66 closed 5 years ago

bot66 commented 5 years ago

Why add 1... I need help... util.py line37 to line41 b1_area = (b1_x2 - b1_x1 + 1) * (b1_y2 - b1_y1 + 1) b2_area = (b2_x2 - b2_x1 + 1) * (b2_y2 - b2_y1 + 1)

bot66 commented 5 years ago

I found my anwser in kaggle ! reason for add 1 is about to avoid 0/0 situation,soomth the value. https://www.kaggle.com/iezepov/fast-iou-scoring-metric-in-pytorch-and-numpy