Skip to main content

Your first Infinigen scene (Hello World!)

Instructions

In this tutorial, we will show you how to generate a single image with Infinigen with depth annotations:

This tutorial does not require a GPU, and assumes all optional compilation steps were skipped.

Memory Requirements

These commands consume in excess of 15GB of memory.

Reproducibility

You may obtain a rearranged scene due to platform-specific library versions. On some platforms, the scenes are sometimes not 100% deterministicm which could result in variation of memory use across runs and possible out-of-memory failures. This is a known issue that we are looking into.

System

The current example does not yet work for Mac OS.

These issues are expected to be resolved soon.

To generate this image, run:

cd worldgen
mkdir outputs
../blender/blender --background -noaudio --python generate.py -- --seed 3be70e09 --task coarse -g desert simple --output_folder outputs/helloworld/coarse
../blender/blender --background -noaudio --python generate.py -- --seed 3be70e09 --task populate fine_terrain -g desert simple --input_folder outputs/helloworld/coarse --output_folder outputs/helloworld/fine
../blender/blender --background -noaudio --python generate.py -- --seed 3be70e09 --task render -g desert simple --input_folder outputs/helloworld/fine --output_folder outputs/helloworld/frames
../blender/blender --background -noaudio --python generate.py -- --seed 3be70e09 --task render -g desert simple --input_folder outputs/helloworld/fine --output_folder outputs/helloworld/frames -p render.render_image_func=@flat/render_image

This example can take 15 minutes to an hour, depending on your platform.

The resulting images and dense annotations will be located in: outputs/helloworld

You can run ../blender/blender outputs/helloworld/coarse/scene.blend to view the intermediate "relatively low poly" file, or ../blender/blender outputs/helloworld/fine/scene.blend to view the full file that is rendered. Both of these will have many meshes hidden in the editor by default, to help performance.

Ready to remove the guardrails? Try the following:

Swap 'desert' for any of config/scene_types to get different biome (or write your own config!). You can also add in the name of any file in configs. Change the seed to any number to get different scenes Remove 'simple' to generate more detailed (EXPENSIVE) scenes Read and customize generate.py to understand how infinigen works under the hood. Append -p compose_scene.grass_chance=1.0 to the first command to force grass (or any of generate.py's 'run_stage' asset names) to appear in the scene. You can modify the kwargs @gin.configurable() python function in the entire repo via this mechanism.

experimenting with Infinigen

As you experiment with the system using your own settings and random seeds, it will crash with some frequency (due to the wide variance of resources required across scenes, and for various other reasons).

Different configurations may result in large memory spikes, or very long runtimes, due to wide variantions of scene complexity. In these cases, it often makes sense to simply pick a different random seed.

github issues

Please check the Github issues page for help debugging.

Before posting a new issue, please include:

  • stdout logs after running with
    • --debug
    • /usr/bin/time -v (or gtime -v for mac)
  • your compute platform:
    • Operating System
    • Memory
    • Graphics Card (if any)
    • Anything else which may be useful