autowebcompat icon indicating copy to clipboard operation
autowebcompat copied to clipboard

Create final bounding_box.json file from bounding boxes of different users

Open sagarvijaygupta opened this issue 6 years ago • 9 comments

To create final bounding_box.json file, I am thinking of having IOU as the basic criteria with some defined threshold with at least 50% bounding_box.json from the label_persons directory agreeing with it. We can discuss different ideas in this thread.

sagarvijaygupta avatar Apr 13 '18 14:04 sagarvijaygupta

@sagarvijaygupta i have a couple of doubts in this regard , do you mean for each person A you'll keep adding the bounding box they created for a particular set of images to the bounding box jsons and then apply IOU with a threshold to get one definite value?

Shashi456 avatar Apr 13 '18 14:04 Shashi456

@Shashi456 I am thinking of using all the bounding boxes for a given screenshot by all users who have annotated them and calculate the maximum area of intersection with maximum people agreeing with it (there will be trade off between area of intersection and more people agreeing with it - what trade off will be best I am not sure). Now for this area we know the bounding box we are talking about for every user, so I start taking union of these bounding boxes with the found area of intersection one by one (sorted on the basis of area) such that their IOU with the found intersection is above the threshold.

sagarvijaygupta avatar Apr 13 '18 18:04 sagarvijaygupta

I was going through https://arxiv.org/pdf/1506.01497.pdf faster RCNN and came across NMS (Non-Maximum Suppression). I think it will be more preferable. @marco-c any thoughts about it?

sagarvijaygupta avatar Apr 14 '18 05:04 sagarvijaygupta

It sounds interesting, but maybe it's too much work?

marco-c avatar Apr 18 '18 23:04 marco-c

@marco-c I searched about NMS and found it is much similar to what I proposed above. If by

too much work

you mean about the length of code, it won't be much and is quiet easy to understand. https://www.pyimagesearch.com/2015/02/16/faster-non-maximum-suppression-python/ has an implementation of it which is simple and fast enough. We can think about other possible options also. As after this only we will be able to provide information from these bounding boxes for training.

sagarvijaygupta avatar Apr 19 '18 08:04 sagarvijaygupta

Sounds good then!

marco-c avatar Apr 19 '18 08:04 marco-c

old new

@marco-c This is the output I am getting with overlapping threshold value of 0.5. Is it fine? Or should I make some changes. Also I wanted to ask one thing. What should I do with the read_labels in utils.py? I mean we have some already labeled data. If we remove labels.csv we will lose the information. Should I just create the final_bounding_box.json and keep read_labels as it is (and everything else the same and continue writing labels separately) till we have sufficient marked data with bounding_box.json after which read_labels can be updated and labels.csv removed?

sagarvijaygupta avatar Apr 21 '18 06:04 sagarvijaygupta

This is the output I am getting with overlapping threshold value of 0.5. Is it fine? Or should I make some changes.

It looks OK to me.

Also I wanted to ask one thing. What should I do with the read_labels in utils.py? I mean we have some already labeled data. If we remove labels.csv we will lose the information. Should I just create the final_bounding_box.json and keep read_labels as it is (and everything else the same and continue writing labels separately) till we have sufficient marked data with bounding_box.json after which read_labels can be updated and labels.csv removed?

Let's convert the current file, making the boundary box the entire image when an image was labeled with n or d.

marco-c avatar Apr 30 '18 11:04 marco-c

(The label_persons/amitrockon.csv should be converted, labels.csv should be generated automatically)

marco-c avatar Apr 30 '18 11:04 marco-c