Box1_area and box2_area logic giving error. Need help on this

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

following is implementation in iou() function.

please give some direction to resolve this issue.

Assignment is on ‘Car detection with YOLO’.

You filed this under “General Discussions” subcategory “Data Centric AI”. Say what? As you comment in the text, this is about DLS Course 4. You’ll generally have better luck getting answers if you file things under the relevant category. I moved it for you using the little “edit pencil” on the title.

Well, do you believe the statement that the intersection area should be less than the union area? Sounds reasonable, right? So what are your area values? Did you try printing out the intermediate values in your function and then double checking that they make sense? You can draw the picture based on the coordinates and work out what the answer should be with pencil and paper. Checking your work: you can actually do it in this case.

Thank You very much. I think, instructor updated the code to default and I did step by step again. it worked well.