facebookresearch / clevr-dataset-gen

A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning
Other
577 stars 204 forks source link

Bounding boxes in scene files #8

Closed erobic closed 6 years ago

erobic commented 6 years ago

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?

erobic commented 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

erobic commented 5 years ago

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

saharudra commented 5 years ago

@erobic The bounding boxes using this script are not tight.

erobic commented 5 years ago

@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.