Skip to content
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

What is the purpose of adding 1 while calculating the box area? #27

Open
jayden199012 opened this issue Oct 15, 2018 · 1 comment
Open

Comments

@jayden199012
Copy link

In the IoU function

#Intersection area inter_area = torch.clamp(inter_rect_x2 - inter_rect_x1 + 1, min=0) * torch.clamp(inter_rect_y2 - inter_rect_y1 + 1, min=0) inter_areaa = torch.clamp(inter_rect_x2 - inter_rect_x1, min=0) * torch.clamp(inter_rect_y2 - inter_rect_y1, min=0)

what is the reason for the + 1 while calculating the area?

Is it to avoid 0 division error for calculating IoU? But won't it affect the value by adding a constant to the area?

@bot66
Copy link

bot66 commented Oct 11, 2019

It's about to avoid 0/0 situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants