C4, W3, A1,Autonomous_driving_application_Car_detection

exercise 2 iou:
this is my implementation of intersection,

{moderator edit: template and code removed}

getting this error: “Wrong value. Check your implementation. Problem with intersecting boxes”

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

i looked at my implementation several time, but nothing clicked.
any help will be appriciated :slight_smile:

Calculations for xi2 and yi2 are incorrect. Remember that top left is (0, 0). Do see the additional notes in the exercise writeup.