Skip to content

Commit

Permalink
Infinigen v1.0.1 - BSD-3 license, expanded ground-truth docs, show li…
Browse files Browse the repository at this point in the history
…ne-credits, miscellaneous fixes
  • Loading branch information
pvl-bot committed Jul 1, 2023
1 parent 3040c22 commit e0b75a8
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 50 deletions.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Request
about: Request a feature!
title: "[REQUEST]"
labels: ''
assignees: ''

---

**Describe the feature you would like to see implemented**

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v1.0.0 - Beta code release <br>
v1.0.1 - BSD-3 license, expanded ground-truth docs, show line-credits, miscellaneous fixes
2 changes: 1 addition & 1 deletion GroundTruthAnnotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Infinigen can produce some dense annotations using Blender's built-in render passes. Users may prefer to use these annotations over our extended annotation system's since it requires only the bare-minimum installation. It is also able to run without a GPU.

These annotations are produced when using the `--pipeline_configs opengl_gt` ground truth extraction config in [manage_datagen_jobs.py](/README.md#generate-images-in-one-command), or can be done manually as shown in the final step of the [Hello-World](/README.md#generate-a-scene-step-by-step) example.
These annotations are produced when using the `--pipeline_configs blender_gt` ground truth extraction config in [manage_datagen_jobs.py](/README.md#generate-images-in-one-command), or can be done manually as shown in the final step of the [Hello-World](/README.md#generate-a-scene-step-by-step) example.

### Specification

Expand Down
45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ Installation is tested and working on the following platforms:

We are working on support for rendering with AMD GPUs. Windows users should use [WSL2](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview). More instructions coming soon.

<details closed>
<summary><b>:warning: Errors with git pull / merge conflicts when migrating from v1.0.0 to v1.0.1</b></summary>
To properly display open-source line by line git credits for our team, we have switched to a new version of the repo which does not share commit history with the the version available from 6/17/2023 to 6/29/2023 date. We hope this will help open source contributors identify the current "code owner" or person best equipped to support you with issues you encounter with any particular lines of the codebase.

You will not be able to pull or merge infinigen v1.0.1 into a v1.0.0 repo without significant git expertise. If you have no ongoing changes, we recommend you clone a new copy of the repo. We apologize for any inconvenience, please make an issue if you have problems updating or need help migrating ongoing changes. We understand this change is disruptive, but it is one-time-only and will not occur in future versions. Now it is complete, we intend to iterate rapidly in the coming weeks, please see our [roadmap](https://infinigen.org/roadmap) and [twitter](https://twitter.com/PrincetonVL) for updates.
</details closed>

**Run these commands to get started**
```
git clone https://github.com/princeton-vl/infinigen.git
git clone --recursive https://github.com/princeton-vl/infinigen.git
cd infinigen
conda create --name infinigen python=3.10
conda activate infinigen
Expand Down Expand Up @@ -87,7 +94,7 @@ Install [WSL2](https://infinigen.org/docs/installation/intro#setup-for-windows)

### "Hello World": Generate your first Infinigen scene

:warning: **Known issue** :warning: : We are actively fixing an issue which causes commands not to be reproducible on many platforms. The same command may produce multiple rearranged scenes with different runtimes and memory requirements.
:warning: **Known issue** : We are actively fixing an issue which causes commands not to be reproducible on many platforms. The same command may produce multiple rearranged scenes with different runtimes and memory requirements.

<p align="center">
<img src="images/Image0048_00_00.png" width="330" />
Expand Down Expand Up @@ -116,8 +123,6 @@ $BLENDER -noaudio --background --python generate.py -- --seed 0 --task render -g
$BLENDER -noaudio --background --python generate.py -- --seed 0 --task render -g desert simple --input_folder outputs/helloworld/fine --output_folder outputs/helloworld/frames -p render.render_image_func=@flat/render_image
```

The full specification for the ground-truth is located in [GroundTruthAnnotations.md](/GroundTruthAnnotations.md), including instructions for our own OpenGL-based implementation with additional annotations.

Output logs should indicate what the code is working on. Use `--debug` for even more detail. After each command completes you can inspect it's `--output_folder` for results, including running `$BLENDER outputs/helloworld/coarse/scene.blend` or similar to view blender files. We hide many meshes by default for viewport stability; to view them, click "Render" or use the UI to unhide them.

#### Generate image(s) in one command
Expand All @@ -144,6 +149,26 @@ If you intend to use CUDA-accelerated terrain (`--pipeline_configs cuda_terrain`

Infinigen uses [Google's "Gin Config"](https://github.com/google/gin-config) heavily, and we encourage you to consult their documentation to familiarize yourself with its capabilities.

<details closed>
<summary><b>:bulb: Generating high quality videos / Avoiding terrain aliasing</b></summary>

To render high quality videos as shown in the intro video, we ran commands similar to the following, on our SLURM cluster.

```
python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scenes 500 \
--pipeline_config slurm monocular_video cuda_terrain opengl_gt \
--cleanup big_files --warmup_sec 60000 --config trailer high_quality_terrain
```

Our terrain system resolves its signed distance function (SDF) to view-specific meshes, which must be updated as the camera moves. For video rendering, we strongly recommend using the `high_quality_terrain` config to avoid perceptible flickering and temporal aliasing. This config meshes the SDF at very high detail, to create seamless video. However, it has high compute costs, so we recommend also using `--pipeline_config cuda_terrain` on a machine with an NVIDIA GPU. For applications with fast moving cameras, you may need to update the terrain mesh more frequently by decreasing `iterate_scene_tasks.view_block_size = 16` in `worldgen/tools/pipeline_configs/monocular_video.gin`

As always, you may attempt to switch the compute platform (e.g from `slurm` to `local_256GB`) or the data format (e.g. from `monocular_video` to `stereo_video`).

</details>

#### Generating and using ground-truth

:exclamation: Infinigen provides a ground-truth system for generating diverse automatic annotations for computer vision. [See the docs here](/GroundTruthAnnotations.md).

## Exploring the Infinigen Codebase

Expand All @@ -152,15 +177,7 @@ Infinigen has evolved significantly since the version described in our CVPR pape
Infinigen is an ongoing research project, and has some known issues. Through experimenting with Infinigen's code and config files, you will find scenes which crash or cannot be handled on your hardware. Infinigen scenes are randomized, with a long tail of possible scene complexity and thus compute requirements. If you encounter a scene that does not fit your computing hardware, you should try other seeds, use other config files, or follow up for help.

## Coming Soon

Infinigen will evolve rapidly over the coming months. Follow us at [https://twitter.com/PrincetonVL](https://twitter.com/PrincetonVL) for updates.

There are some aspects of the code used for our launch video that are still being polished and will be released as soon as possible, notably:
- Fluid simulations for dynamic water and fire
- Some categories of plants, namely snake plants and spider plants

### Tutorials & Documentation
We will add comprehensive tutorials and documentation for all aspects of Infinigen. This README is **preliminary**, and our docs will be expanded to cover all aspects of the project in detail.
Please see our project roadmap and follow us at [https://twitter.com/PrincetonVL](https://twitter.com/PrincetonVL) for updates.

### Contributing
We welcome contributions! You can contribute in many ways:
Expand All @@ -184,7 +201,7 @@ Infinigen wouldn't be possible without the fantastic work of the [Blender Founda

We thank [Thomas Kole](https://blenderartists.org/u/ThomasKole) for providing procedural clouds (which are more photorealistic than our original version) and [Pedro P. Lopes](https://blendswap.com/blend/30728) for the autoexposure nodegraph.

We learned tremendously from online tutorials from
We learned tremendously from online tutorials of
[Andrew Price](https://www.youtube.com/channel/UCOKHwx1VCdgnxwbjyb9Iu1g),
[Artisans of Vaul](https://www.youtube.com/@ArtisansofVaul),
[Bad Normals](https://www.youtube.com/@BadNormals),
Expand Down
5 changes: 5 additions & 0 deletions process_mesh/buffer_arrays.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Copyright (c) Princeton University.
// This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.

// Authors: Lahav Lipson

#include "buffer_arrays.hpp"
#include <string>
#include <unordered_map>
Expand Down
2 changes: 2 additions & 0 deletions worldgen/asset_demo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.

# Authors: Alexander Raistrick

import argparse
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion worldgen/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

from assets.utils.tag import tag_system

VERSION = '1.0.0'
VERSION = '1.0.1'

def sanitize_gin_override(overrides: list):
if len(overrides) > 0:
Expand Down
30 changes: 2 additions & 28 deletions worldgen/surfaces/templates/lava.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,41 +287,22 @@ def lava_geo(nw, selection=None, random_seed=0, geometry=True):

separate_xyz = nw.new_node(Nodes.SeparateXYZ, input_kwargs={"Vector": position})

# group_3 = nw.new_node(
# nodegroup_normalize_0_1().name,
# input_kwargs={
# "Attribute": separate_xyz.outputs["X"],
# "Geometry": group_input.outputs["Geometry"],
# },
# )
group_3 = nw.scalar_divide(
nw.scalar_add(
separate_xyz.outputs["X"],
200
),
400
)
# group_4 = nw.new_node(
# nodegroup_normalize_0_1().name,
# input_kwargs={
# "Attribute": separate_xyz.outputs["Y"],
# "Geometry": group_input.outputs["Geometry"],
# },
# )

group_4 = nw.scalar_divide(
nw.scalar_add(
separate_xyz.outputs["Y"],
200
),
400
)
# group = nw.new_node(
# nodegroup_normalize_0_1().name,
# input_kwargs={
# "Attribute": separate_xyz.outputs["Z"],
# "Geometry": group_input.outputs["Geometry"],
# },
# )

group = nw.scalar_divide(
nw.scalar_add(
separate_xyz.outputs["Z"],
Expand Down Expand Up @@ -351,13 +332,6 @@ def lava_geo(nw, selection=None, random_seed=0, geometry=True):
attrs={"operation": "MULTIPLY_ADD"},
)

# group_1 = nw.new_node(
# nodegroup_normalize_0_1().name,
# input_kwargs={
# "Attribute": multiply_add,
# "Geometry": group_input.outputs["Geometry"],
# },
# )
group_1 = nw.scalar_divide(
nw.scalar_add(
multiply_add,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright: 2009-2022 the scikit-image team
# License: BSD-3-Clause
# adapted by Zeyu Ma on date June 5, 2023 to avoid precision loss for large grids to achieve local determinism,
# adapted by Zeyu Ma to avoid precision loss for large grids to achieve local determinism,
# therefore to make seamless stiched mesh

#cython: cdivision=True
Expand Down
2 changes: 1 addition & 1 deletion worldgen/terrain/mesher/_marching_cubes_lewiner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright: 2009-2022 the scikit-image team
# License: BSD-3-Clause
# adapted by Zeyu Ma on date June 5, 2023 to avoid precision loss for large grids to achieve local determinism,
# adapted by Zeyu Ma to avoid precision loss for large grids to achieve local determinism,
# therefore to make seamless stiched mesh

import base64
Expand Down
2 changes: 1 addition & 1 deletion worldgen/terrain/mesher/_marching_cubes_lewiner_luts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright: 2009-2022 the scikit-image team
# License: BSD-3-Clause
# adapted by Zeyu Ma on date June 5, 2023 to avoid precision loss for large grids to achieve local determinism,
# adapted by Zeyu Ma to avoid precision loss for large grids to achieve local determinism,
# therefore to make seamless stiched mesh

# This file was auto-generated from `mc_meta/LookUpTable.h` by
Expand Down
2 changes: 1 addition & 1 deletion worldgen/terrain/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Copyright: 2009-2022 the scikit-image team
# License: BSD-3-Clause
# adapted by Zeyu Ma on date June 5, 2023 to avoid precision loss for large grids to achieve local determinism,
# adapted by Zeyu Ma to avoid precision loss for large grids to achieve local determinism,
# therefore to make seamless stiched mesh

from skimage._build import cython
Expand Down
2 changes: 1 addition & 1 deletion worldgen/terrain/source/common/utils/FastNoiseLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
//
// VERSION: 1.0.1
// https://github.com/Auburn/FastNoise
// adapted by Zeyu Ma on date June 4, 2023 to compile terrain elements
// adapted by Zeyu Ma to compile terrain elements

#ifndef FASTNOISELITE_H
#define FASTNOISELITE_H
Expand Down
2 changes: 1 addition & 1 deletion worldgen/terrain/source/common/utils/smooth_bool_ops.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The MIT License
// Copyright © 2018 Inigo Quilez
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// adopted by Zeyu Ma on date June 5, 2023 to compile terrain elements
// adopted by Zeyu Ma to compile terrain elements

DEVICE_FUNC float smooth_union(float d1, float d2, float k) {
float h = max(k - abs(d1 - d2), 0.0f);
Expand Down
5 changes: 5 additions & 0 deletions worldgen/tools/ground_truth/bounding_boxes_3d.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.

# Authors: Lahav Lipson

import argparse
import json
from itertools import chain
Expand Down
5 changes: 5 additions & 0 deletions worldgen/tools/ground_truth/optical_flow_warp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.

# Authors: Lahav Lipson

import argparse
import json
from pathlib import Path
Expand Down
5 changes: 5 additions & 0 deletions worldgen/tools/ground_truth/rigid_warp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.

# Authors: Lahav Lipson

import argparse
import json
from pathlib import Path
Expand Down
5 changes: 5 additions & 0 deletions worldgen/tools/ground_truth/segmentation_lookup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Princeton University.
# This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree.

# Authors: Lahav Lipson

import argparse
import colorsys
import json
Expand Down

0 comments on commit e0b75a8

Please sign in to comment.