I have a Symbol detection algorithm, which can be output from template matching/ faster rcnn or combining the results from both of them, which gives me the coordinates filename,xmin, ymin, xmax, ymax, class, confidence.
The issue is that there are multiple bounding boxes occurring for the same object. How I can efficiently filter these boxes and get only the boxes with maximum confidence in the area removing duplicates.
sample Image:
The sample coordinate data frame:
df=pd.DataFrame({'filename':['dummyfile.jpg']*5, class=['cube']*5, xmin':[88,87,65,492,470],'ymin':[87,111,110,187,184],'xmax':[197,198,174,603,578],
'ymax':[198,220,221,295,295],'confidence':[0.99,0.88,0.95,0.89,0.83]})
class confidence filename xmax xmin ymax ymin
0 cube 0.99 dummyfile.jpg 197 88 198 87
1 cube 0.88 dummyfile.jpg 198 87 220 111
2 cube 0.95 dummyfile.jpg 174 65 221 110
3 cube 0.89 dummyfile.jpg 603 492 295 187
4 cube 0.83 dummyfile.jpg 578 470 295 184
Image representation:
Expected output:
I tried filtering using confidence as a threshold, but it will affect the recall of the solution. How to remove these duplicates making use of IoU?



