Skip to content

Commit

Permalink
Merge pull request internal-188 from princeton-vl/develop
Browse files Browse the repository at this point in the history
v1.5.0
  • Loading branch information
pvl-bot committed Jul 9, 2024
2 parents 967970e + c9d1c8b commit 931d1e5
Show file tree
Hide file tree
Showing 1,031 changed files with 141,915 additions and 106,869 deletions.
25 changes: 25 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# CODEOWNERS
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# This file specifies only who must review each file, IE, who is the primary maintainer / responsibility holder

# araistrick will review everything except where specified below
* @araistrick

infinigen/datagen/customgt/* @lahavlipson
infinigen/tools/ground_truth/* @lahavlipson

infinigen/terrain/* @mazeyu

infinigen/core/constraints/evaluator/node_impl/* @karhankayan
infinigen/core/constraints/example_solver/room/* @JerryLingjieMei

infinigen/tools/export.py @David-Yan-1

infinigen/assets/utils/* @JerryLingjieMei
infinigen/assets/fluid/* @karhankayan

# Jerry will review all object assets except where specified below
infinigen/assets/objects/* @JerryLingjieMei
infinigen/assets/objects/creatures/* @araistrick
infinigen/assets/objects/trees/* @araistrick
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/ask-for-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Question
about: Ask for help using the system
title: ""
labels: 'question'
assignees: ''

---

## Steps to Reproduce
If this relates to running the codebase, please provide steps to reproduce:

### What version of the code were you using?
Tell us the commit & commit hash from `git log`

### What command did you run?


### What are your FULL output logs?
Provide the FULL output logs from your command as a txt file.

### If this is your first time running Infinigen, what are the full install logs?**
Run `pip install -v -e . > logs.txt 2>&1` and send logs.txt as an attachment.


### Platform
- OS & OS Version:
- GPU (?) :
- GPU Driver Version (?) :
- RAM (GB):

# Additional context
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Tell us the commit & commit hash from `git log`
Provide the FULL output logs from your command as a txt file.

### If this is your first time running Infinigen, what are the full install logs?**
Run `pip install -vv -e . > logs.txt 2>&1` and send logs.txt as an attachment.
Run `pip install -v -e . > logs.txt 2>&1` and send logs.txt as an attachment.


### Platform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Request
about: Request a feature!
name: Suggestion
about: Suggest a new feature
title: ""
labels: 'enhancement'
assignees: ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
ruff check --output-format=github --select=E9,F63,F7,F82 .
# default set of ruff rules with GitHub Annotations
#ruff --format=github . # to be enabled in a future PR
ruff check --output-format=github .
- name: Set up Python 3.10
uses: actions/setup-python@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ blender
blender.tar.xz
Blender.app

*.c

.coverage
coverage.xml

Expand Down
20 changes: 8 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@

repos:

# config from https://black.readthedocs.io/en/stable/integrations/source_version_control.html
#- repo: https://github.com/psf/black
# rev: 23.7.0
# hooks:
# - id: black
# language_version: python3.10

# config from https://github.com/astral-sh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.285
# Ruff version.
rev: v0.4.9
hooks:
# Run the linter.
- id: ruff

# Sort imports
- id: ruff
args: [--select, I, --fix]
# Run the formatter.
- id: ruff-format
9 changes: 8 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,11 @@ v1.4.0 - Infinigen Indoors
v1.4.1
- @David-Yan1 fix placeholder & ocmesher submodule version
- @lahavlipson fix bug in surface normals of wall meshes
- @araistrick bugfix example commands & other typos
- @araistrick bugfix example commands & other typos

v1.5.0
- ruff & auto-lint-fix the entire codebase
- move mesh assets into infinigen/assets/objects
- minimize pip dependences: remove unused packages & move terrain/gt-vis packages into optional \[terrain,vis\] extras.
- add parameters for object clutter, reduce excessively cluttered / slow indoors scenes
- minorly improve infinigen-indoors performance via logging & asset hiding
20 changes: 10 additions & 10 deletions docs/ConfiguringInfinigen.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Our `infinigen_examples/generate_nature.py` driver always loads [`infinigen_exam

Now that you understand the two major python programs and how to configure them, you may notice and wonder about the many configs/overrides provided in our original one-command "Hello World" example:

```
```bash
# Original hello world command
python -m infinigen.datagen.manage_jobs --output_folder outputs/hello_world --num_scenes 1 --specific_seed 0 \
--configs desert.gin simple.gin --pipeline_configs local_16GB.gin monocular.gin blender_gt.gin \
Expand Down Expand Up @@ -169,23 +169,23 @@ All commands below are shown with using `local_256GB` config, but you can attemp

We recommend this command as a starting point for generating high quality videos. Generating multi-view consistent terrain is not computationally tractible without CUDA accelleration, so make sure to follow the CUDA Terrain instructions in Installation.md, and we recommend not to remove the `cuda_terrain` flag below.

````
```bash
python -m infinigen.datagen.manage_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_video high_quality_terrain
````
```

#### Creating large-scale stereo datasets

````
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/stereo_data --num_scenes 10000 \
--pipeline_config slurm stereo cuda_terrain opengl_gt \
--cleanup big_files --warmup_sec 60000 --config high_quality_terrain
````
```

#### Creating a few low-resolution images to your test changes

```
```bash
screen python -m infinigen.datagen.manage_jobs --output_folder outputs/dev --num_scenes 50 \
--pipeline_config slurm monocular cuda_terrain \
--cleanup big_files --warmup_sec 1200 --configs dev
Expand All @@ -196,7 +196,7 @@ screen python -m infinigen.datagen.manage_jobs --output_folder outputs/dev --num
These commands are intended as inspiration - please read docs above for more advice on customizing all aspects of Infinigen.

<b> Create images that always have rain: </b>
```
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_scenes 500 \
--pipeline_config slurm monocular cuda_terrain opengl_gt \
--cleanup big_files --warmup_sec 30000 \
Expand All @@ -206,7 +206,7 @@ python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_
:bulb: You can substitute the `rain_particles` in `rain_particles_chance` for any `run_stage` name argument string in `infinigen_examples/generate_nature.py`, such as `trees` or `ground_creatures`.

<b> Create images that only have terrain: </b>
```
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_scenes 500 \
--pipeline_config slurm monocular cuda_terrain opengl_gt \
--cleanup big_files --warmup_sec 30000 --config no_assets
Expand All @@ -215,7 +215,7 @@ python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_

<b> Create videos at birds-eye-view camera altitudes: </b>

```
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_scenes 500 \
--pipeline_config slurm monocular_video cuda_terrain opengl_gt \
--cleanup big_files --warmup_sec 30000 --config trailer_video high_quality_terrain \
Expand All @@ -225,7 +225,7 @@ python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_
:bulb: The command shown is overriding `infinigen_examples/configs_nature/base.gin`'s default setting of `camera.camera_pose_proposal.altitude`. You can use a similar syntax to override any number of .gin config entries. Separate multiple entries with spaces.

<b> Create 1 second video clips: </b>
```
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/my_videos --num_scenes 500 \
--pipeline_config slurm monocular_video cuda_terrain opengl_gt \
--cleanup big_files --warmup_sec 30000 --config trailer_video high_quality_terrain \
Expand Down
15 changes: 8 additions & 7 deletions docs/GeneratingFluidSimulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ Before you can generate fluids, you must run an additional installation step: `b
## Example Commands

#### Generate a video of a single scene with simulated fire generated on the fly
```
```bash
python -m infinigen.datagen.manage_jobs --specific_seed 3930249d --output_folder outputs/fire --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin --cleanup none --config plain.gin fast_terrain_assets.gin use_on_the_fly_fire.gin
```
Because fluid simulation takes a long time, the fire resolution can be reduced in use_on_the_fly_fire.gin, by setting `set_obj_on_fire.resolution = {resolution}`. This will reduce the fire quality but speed up the simulation.

#### Generate a video of a single valley scene with simulated river
```
```bash
python -m infinigen.datagen.manage_jobs --specific_seed 61fc881a --output_folder outputs/river --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin opengl_gt.gin cuda_terrain.gin --pipeline_overrides iterate_scene_tasks.frame_range=[100,244] --config river.gin simulated_river.gin no_assets.gin no_creatures.gin fast_terrain_assets.gin --cleanup none
```
Similar to fire, the simulation can be sped up by reducing the resolution. In simulated_river.gin, the resolution can be modified by setting `make_river.resolution = {resolution}`. The simulation can also be sped up by reducing the simulation duration in simulated_river.gin by setting `make_river.simulation_duration = {duration}`. For instance, before running the command above, the duration can be reduced to a number greater than 200 since that is the last frame of the video.

Also, note that this command will produce a scene without assets to speed up the process. However, the liquids generally interact with the objects by splashing on them, and a scene like this can be produced by removing the `no_assets.gin` option in the above command.

#### Generate videos of random scene types, with simulated fire generated on the fly when needed
```
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/onthefly --num_scenes 10 \
--pipeline_config slurm_high_memory.gin monocular_video.gin \
--config fast_terrain_assets.gin use_on_the_fly_fire.gin \
--cleanup none --warmup_sec 12000
```

#### Generate videos of valley scenes with simulated rivers
```
```bash
python -m infinigen.datagen.manage_jobs --output_folder /n/fs/pvl-renders/kkayan/river --num_scenes 10 \
--pipeline_config slurm_high_memory.gin monocular_video.gin opengl_gt.gin cuda_terrain.gin \
--pipeline_overrides iterate_scene_tasks.frame_range=[100,244] \
Expand All @@ -44,20 +44,21 @@ python -m infinigen.datagen.manage_jobs --output_folder /n/fs/pvl-renders/kkayan
## Using Pre-Generated Fire

High-resolution fluid simulations take a long time, so assets on fire can pre-generated and imported in the scene instead of being baked on-the-fly. This allows for fire to be simulated once, instead of every time a scene is generated. To pre-generate fire assets of all types (bush, tree, creature, cactus, boulder), run:
```
```bash
python -m infinigen.tools.submit_asset_cache -f {fire_asset_folder} -n 1 -s -40 -d 184
```
where `fire_asset_folder` is where you want to save the fire. The number of assets per type, start frame and duration can be adjusted.

If you only want to pre-generate one type of asset once, run:
```
```bash
python -m infinigen.assets.fluid.run_asset_cache -f {fire_asset_folder} -a {asset} -s {start_frame} -d {simulation_duration}
```
where `fire_asset_folder` is where you want to save the fire. `asset` can be one of `CachedBushFactory`, `CachedTreeFactory`, `CachedCactusFactory`, `CachedCreatureFactory`, `CachedBoulderFactory`.

### Import pre-generated fire when generating a scene
After fire is pre-generated with one of the previous commands, edit config/use_cached_fire.gin and set the `FireCachingSystem.asset_folder` variable to `fire_asset_folder` you used when pre-generating fire. After this `use_cached_fire.gin` can be used instead of `use_on_the_fly_fire.gin` when generating a scene. This will import the fire from the folder it is saved instead of simulating it on-the-fly.

#### Example Command
```
```bash
python -m infinigen.datagen.manage_jobs --specific_seed 3930249d --output_folder outputs/fire --num_scenes 1 --pipeline_config local_256GB.gin monocular_video.gin --cleanup none --config plain.gin fast_terrain_assets.gin use_cached_fire.gin
```
8 changes: 8 additions & 0 deletions docs/GroundTruthAnnotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

**Want annotations that we don't currently support? [Fill out a request!](https://github.com/princeton-vl/infinigen/issues/new?assignees=&labels=&projects=&template=request.md&title=%5BREQUEST%5D)**

### Visualization dependencies

To run the visualization scripts below you will need to install extra dependencies

```bash
pip install .[vis]
```

## Default Annotations from Blender

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.
Expand Down
2 changes: 1 addition & 1 deletion docs/HelloRoom.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ We also provide an OpenGL-based ground truth extractor which offers additional g

To generate a single scene in one command, you can run the following:
```bash
screen python -m infinigen.datagen.manage_jobs --output_folder outputs/my_dataset --num_scenes 1000 --pipeline_configs local_256GB.gin monocular.gin blender_gt.gin indoor_background_configs.gin --configs singleroom.gin --pipeline_overrides get_cmd.driver_script='infinigen_examples.generate_indoors' manage_datagen_jobs.num_concurrent=16 --overrides compose_indoors.restrict_single_supported_roomtype=True
screen python -m infinigen.datagen.manage_jobs --output_folder outputs/my_dataset --num_scenes 1 --pipeline_configs local_256GB.gin monocular.gin blender_gt.gin indoor_background_configs.gin --configs singleroom.gin --pipeline_overrides get_cmd.driver_script='infinigen_examples.generate_indoors' manage_datagen_jobs.num_concurrent=16 --overrides compose_indoors.restrict_single_supported_roomtype=True
```

To create a large dataset of many random rooms, we recommend:
Expand Down
4 changes: 2 additions & 2 deletions docs/HelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Infinigen generates scenes by running multiple tasks (usually executed automatic

:exclamation: If you encounter any missing .so files, missing dependencies (such as `gin`), or similar crashes, please check again that all steps of installation ran successfully. If you cannot resolve any issues with installation, please see our README and 'Bug Report' Git Issue template for advice on posting Git Issues to get help quickly - you must include the full installation logs in your issue so that we can help debug.

```
```bash
mkdir outputs

# Generate a scene layout
Expand All @@ -40,7 +40,7 @@ Output logs should indicate what the code is working on. Use `--debug` for even

We provide `infinigen/datagen/manage_jobs.py`, a utility which runs similar steps automatically.

```
```bash
python -m infinigen.datagen.manage_jobs --output_folder outputs/hello_world --num_scenes 1 --specific_seed 0 \
--configs desert.gin simple.gin --pipeline_configs local_16GB.gin monocular.gin blender_gt.gin --pipeline_overrides LocalScheduleHandler.use_gpu=False
```
Expand Down
2 changes: 1 addition & 1 deletion docs/ImplementingAssets.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class MyAssetFactory(AssetFactory):

You can implement the `create_asset` function however you wish so long as it produces a Blender Object as a result. Many existing assets use various different strategies, which you can use as examples:
- `assets/flower.py` uses mostly auto-generated code from transpiling a hand-designed geometry node-graph.
- `assets/grassland/grass_tuft.py` uses pure NumPy code to create and define a mesh.
- `assets.objects.grassland/grass_tuft.py` uses pure NumPy code to create and define a mesh.
- `assets/trees/infinigen_examples/generate_nature.py` combines transpiled materials & leaves with a python-only space colonization algorithm.

The simplest implementation for a new asset is to create a geometry nodes equivelant, transpile it similarly to as shown above, copy the code into the same file as the template shown above, and implement the `create_asset` function as shown:
Expand Down
7 changes: 4 additions & 3 deletions docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ Then, install the infinigen package using one of the options below:
INFINIGEN_MINIMAL_INSTALL=True pip install -e .

# Full install (Terrain & OpenGL-GT enabled, needed for Infinigen-Nature HelloWorld)
pip install -e .
pip install -e .[terrain,vis]

# Developer install (includes pytest, ruff, other recommended dev tools)
pip install -e ".[dev]"
pip install -e ".[dev,terrain,vis]"
pre-commit install
```

:exclamation: If you encounter any issues with the above, please add `-vv > logs.txt 2>&1` to the end of your command and run again, then provide the resulting logs.txt file as an attachment when making a Github Issue.
Expand All @@ -94,7 +95,7 @@ Then, install using one of the options below:
# Minimal installation (recommended setting for use in the Blender UI)
INFINIGEN_MINIMAL_INSTALL=True bash scripts/install/interactive_blender.sh

# Normal install (includes CPU Terrain, and CUDA Terrain if available)
# Normal install
bash scripts/install/interactive_blender.sh

# Enable OpenGL GT
Expand Down
2 changes: 1 addition & 1 deletion infinigen/OcMesher
Submodule OcMesher updated 1 files
+1 −3 ocmesher/__init__.py
7 changes: 6 additions & 1 deletion infinigen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import logging
from pathlib import Path

__version__ = "1.4.1"
__version__ = "1.5.0"


def repo_root():
return Path(__file__).parent.parent
Loading

0 comments on commit 931d1e5

Please sign in to comment.