This folder includes the source code to generate individual reference images as in SPADE, as well as sample assets files for objects and background.

===== INSTRUCTIONS ===== 

1. Install the requirements

    The SPADE Generator uses BlenderProc (https://github.com/DLR-RM/BlenderProc). Please install it via git with the following:

        git clone https://github.com/DLR-RM/BlenderProc
        cd BlenderProc
        pip install -e .

    Once BlenderProc is set, you may run the following test command. It will download the latest version of Blender if you haven't installed Blender locally.

        blenderproc quickstart

2. Generate SPADE images

    We offer two scripts - blender_above_below_small.py and blender_left_right_small.py - that generate SPADE images in vertical and horizontal spatial
    arrangements respectively.

    To generate an image of "an apple above a banana" or "a banana below an apple" on a solid white background, you may run:

        blenderproc run blender_above_below_small.py apple banana background/white-background.hdr output/above_below/ -1 0 

    and the generator will emit the output at output/above_below/apple_banana/0.hdf5

    Likewise, to generate an image of "an apple to the left of a banana" or "a banana to the right of an apple" on a solid white background, you may run:

        blenderproc run blender_left_right_small.py apple banana background/white-background.hdr output/left_right/ -1 0

    and the output will be at output/left_right/apple_banana/0.hdf5

3. Verify generated outputs

    To review the generated images in hdf5 format, you may simply call: 

        blenderproc vis hdf5 output/above_below/apple_banana/0.hdf5