A customized version of the CLEVR dataset's stimulus generation code.
The original code was downloaded from https://cs.stanford.edu/people/jcjohns/clevr/ .
The output/
folder contains copies of the files that will be (re)generated, should you run this code.
- Only tested on Ubuntu 22.04 with Blender 2.83.20. Due to instabilities in Blender's python interface and OS requirements across versions, other OS/Blender version combinations may not work. On windows, WSL2 works well.
- Python is not needed - Blender packs its own version of Python 3.7 and will call the python script within that environment.
- Install Blender 2.83.20. Download the file from https://www.dropbox.com/s/yqukhdfagp2cqaz/blender-2.83.20-linux-x64.zip?dl=1 (preferred), https://www.blender.org/download/lts/2-83/, or https://www.blender.org/download/release/Blender2.83/blender-2.83.20-linux-x64.tar.xz/ and unzip into
custom_clevr_stimgen/
. There should now be acustom_clevr_stimgen/blender-2.83.20-linux-x64
directory. - In bash, cd to
custom_clevr_stimgen/
, then run:echo $PWD/image_generation >> blender-2.83.20-linux-x64/2.83/python/lib/python3.7/site-packages/clevr.pth
- From the
custom_clevr_stimgen/image_generation/
folder, run./renderscript.sh
. This will call blender which will callconfig_images.py
thenrender_images.py
, and generate the json files in theoutput/
folder, the images provided in theoutput/images/
folder, and some blender files. If for some reason this script cannot be run, you may need to executechmod a+x ./renderscript.sh
. Note: Blender is very randomly unstable, so it is possible that a few images won't render. To get any missing images, you can rerun./renderscript.sh
.