In implementation of iou, the iou of intersecting boxes is mentioned to be less than 1. Why is it so? The dimensions mentioned produce iou to be 1. Can someone please clarify?
Think about it for a sec. It’s “intersection” over “union”, right? It could be equal to 1 in the trivial case that both boxes are identical, but it can’t be greater than one.
Right, I got that. In assignment 1, how come the value is 0.14?
You just have to work out the formulas. They lay it all out for you in pretty good detail.
The coordinates of the boxes in the first example are (2, 1, 4, 3) and (1, 2, 3, 4). They explain the coordinate system in the instructions. If you draw yourself a picture, you’ll see that each box is 2 x 2 and that the intersection of the two is 1 x 1. So the areas are:
Intersection = 1
Union = 4 + 4 - intersection = 7
So the iou is 1/7 = 0.14285714…, right?
I’m guessing that the only tricky thing there is the area of the Union. They explained that in the instructions. It’s the sum of the areas minus the area of the intersection, since that gets counted twice, right?
I am getting Union formulation correctly. There is some confusion in my head for calculating intersection, I am getting the intersection area to be 4 (maximum of all coordinates: 2, 2, 4, 4, then performing subtraction, 4-2 and 4-2, which gives intersection area to be 2*2 = 4). Kindly help. In fact, the rest of the calculations for the remaining assignment are correct, except for this particular cell.
Obviously your formula for the intersection is incorrect. I suggest you read the instructions again carefully. They practically write it out for you. It’s the part involving the max and min.
Oops! I read that as maximum for all. Apologies
Glad to hear you found the solution! Anytime you feel “stuck” like this, it’s never a bad idea to just take a deep calming breath and then read the instructions again with an open mind.