Closed erobic closed 6 years ago
In case anyone else needs this, here is the updated code which produces bounding boxes: clevr-dataset-gen with Bounding Boxes
I used the solution presented in: https://blender.stackexchange.com/questions/7198/save-the-2d-bounding-box-of-an-object-in-rendered-image-to-a-text-file
The following script generates bounding boxes from CLEVR's annotation file. No need to re-render the scenes again! https://github.com/larchen/clevr-vqa/blob/master/bounding_box.py
@erobic The bounding boxes using this script are not tight.
@saharudra You may want to play around with formulae inside extract_bounding_boxes
function to get tighter boxes, or may be apply postprocessing steps to further narrow down boxes. These are all just estimates, so they may not be tight. As a last resort, you could re-render the scenes too: https://github.com/erobic/clevr-dataset-gen/blob/da2e75c88ca42f0ea17bcc40c7d8654dd46cb7a2/image_generation/render_images.py.
How do we output bounding boxes for objects? The bound_box property outputs either 1 or -1. It seems like every object occupies the whole scene?