Week 3 excercise 2 iou convolution neural networks

My test function is returning wrong values, any quick pointers . My steps to be correct.
-Sri

iou for intersecting boxes = 2.0

AssertionError Traceback (most recent call last)
in
5
6 print("iou for intersecting boxes = " + str(iou(box1, box2)))
----> 7 assert iou(box1, box2) < 1, “The intersection area must be always smaller or equal than the union area.”
8 assert np.isclose(iou(box1, box2), 0.14285714), “Wrong value. Check your implementation. Problem with intersecting boxes”
9

AssertionError: The intersection area must be always smaller or equal than the union area.

Please note that you filed this in General Discussions about Data Centric AI. This is really a question about DLS Course 4. I’ll move it for you.

FWIW I think we already discussed this on another thread here.

If your answer is incorrect, it’s probably not a correct conclusion that “My steps to be correct.” I added some print statements to my code to show the intersection and union areas for that test case. Here’s what I get:

inter_area 1
union_area 7
iou for intersecting boxes = 0.14285714285714285

What values do you see for the intersection and union? Why are they different from the ones I show above?