Exercise 2 - iou_hint

Hello,

In the exercise there is a hint for finding the intersection of the two boxes (π‘₯𝑖1,𝑦𝑖1,π‘₯𝑖2,𝑦𝑖2) and for
xi1 = max of the x1 coordinates of the two boxes
yi1 = max of the y1 coordinates of the two boxes
xi2= min of the x2 coordinates of the two boxes
yi2= min of the y2 coordinates of the two boxes

But than I drew I saw that
xi1 =min of the x1 coordinates of the two boxes
xi2=max of the x2 coordinates of the two boxes

Isn’t it right?

Hi Lilit.Ghalachyan,

You want the overlap, which reaches from the first point on the x-axis where the boxes start overlapping - which is the highest value of the x1 coordinates of the boxes - to the first point where they stop overlapping - which is the lowest value of the x2 coordinates of the boxes.

In other words, xi1 = max of the x1 coordinates of the two boxes, and xi2 = min of the x2 coordinates of the two boxes.

Thank you for explanation , now I understand.

This might help…

3 Likes

Good visualization, but it seems your yi and xi is in opposite dimension. xi should be horizontal and yi should be vertical

It’s a little cluttered, but note in the diagram that:
xi1 is pointing at b2_x1, which is the max of b2_x1 and b1_x1
yi1 is pointing at b2_y1, which is the max of b2_y1 and b1_y1
etc

x is horizontal, y is vertical, per guidelines for this notebook exercise