Suppose there is a object detection task.
There are many cars in the img. What I need to do, is to draw boxes to detect these cars.
Someone else is doing the same task.
My result is [car1,car2,car5,car6], someone's result is [car1,car3,car5,car5,car7].(carx is the coordinate of #x cat in this img)
Both of us only detect some of the car in the img.
Now I want to find a way evaluate the similarity between our result.
If both of us only find one car, it is easy,
def cal_iou(coordinate_x, coordinate_y):
polygon_x = geometry.Polygon(coordinate_x)
polygon_y = geometry.Polygon(coordinate_y)
intersection = polygon_x.intersection(polygon_y).area
total_area = polygon_x.area + polygon_y.area - intersection
if total_area > 0.0:
return float(intersection / total_area)
return 0.0
I can compute the IoU between two boxex. What if there are more than one box in our result? I don't know which box in other's result should be compared with car1? Another way I think is to get all area in my result, and compare with other's result. But I have not find a good way to do this. plz give me some suggestion