-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iou函数有一点bug #17
Comments
在吴恩达深度学习car detection的代码iou函数中 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"""
iou函数未检测当两个框没有intersection的时候,如
box1 = (1,2,3,4)
box2 = (5,6,7,8)
"""
def iou(box1, box2):
xi1 = np.maximum(box1_x1, box2_x1)
yi1 = np.maximum(box1_y1, box2_y1)
xi2 = np.minimum(box1_x2, box2_x2)
yi2 = np.minimum(box1_y2, box2_y2)
inter_width = xi1-xi2
inter_height =yi1-yi2
inter_area = inter_width * inter_height
#suggest add the code below
if inter_width>0 and inter_height>0:
inter_area = 0
The text was updated successfully, but these errors were encountered: