Open jayden199012 opened 5 years ago
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?
It's about to avoid 0/0 situation.
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?