Skip to content

Commit

Permalink
Reorganize the entire repo (breaks imports)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvl-bot committed Oct 4, 2023
1 parent 3c76764 commit 6265e9a
Show file tree
Hide file tree
Showing 749 changed files with 1,689 additions and 388 deletions.
44 changes: 22 additions & 22 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
[submodule "worldgen/infinigen_gpl"]
path = worldgen/infinigen_gpl
[submodule "infinigen/infinigen_gpl"]
path = infinigen/infinigen_gpl
url = https://github.com/princeton-vl/infinigen_gpl.git
[submodule "process_mesh/dependencies/eigen"]
path = process_mesh/dependencies/eigen
[submodule "infinigen/datagen/custom_ground_truth/dependencies/eigen"]
path = infinigen/datagen/custom_ground_truth/dependencies/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "process_mesh/dependencies/argparse"]
path = process_mesh/dependencies/argparse
[submodule "infinigen/datagen/custom_ground_truth/dependencies/argparse"]
path = infinigen/datagen/custom_ground_truth/dependencies/argparse
url = https://github.com/p-ranav/argparse.git
[submodule "process_mesh/dependencies/cnpy"]
path = process_mesh/dependencies/cnpy
[submodule "infinigen/datagen/custom_ground_truth/dependencies/cnpy"]
path = infinigen/datagen/custom_ground_truth/dependencies/cnpy
url = https://github.com/rogersce/cnpy.git
[submodule "process_mesh/dependencies/indicators"]
path = process_mesh/dependencies/indicators
[submodule "infinigen/datagen/custom_ground_truth/dependencies/indicators"]
path = infinigen/datagen/custom_ground_truth/dependencies/indicators
url = https://github.com/p-ranav/indicators.git
[submodule "process_mesh/dependencies/tinycolormap"]
path = process_mesh/dependencies/tinycolormap
[submodule "infinigen/datagen/custom_ground_truth/dependencies/tinycolormap"]
path = infinigen/datagen/custom_ground_truth/dependencies/tinycolormap
url = https://github.com/yuki-koyama/tinycolormap.git
[submodule "process_mesh/dependencies/glm"]
path = process_mesh/dependencies/glm
[submodule "infinigen/datagen/custom_ground_truth/dependencies/glm"]
path = infinigen/datagen/custom_ground_truth/dependencies/glm
url = https://github.com/g-truc/glm.git
[submodule "process_mesh/dependencies/fast_obj"]
path = process_mesh/dependencies/fast_obj
[submodule "infinigen/datagen/custom_ground_truth/dependencies/fast_obj"]
path = infinigen/datagen/custom_ground_truth/dependencies/fast_obj
url = https://github.com/thisistherk/fast_obj.git
[submodule "process_mesh/dependencies/json"]
path = process_mesh/dependencies/json
[submodule "infinigen/datagen/custom_ground_truth/dependencies/json"]
path = infinigen/datagen/custom_ground_truth/dependencies/json
url = https://github.com/nlohmann/json.git
[submodule "process_mesh/dependencies/stb"]
path = process_mesh/dependencies/stb
[submodule "infinigen/datagen/custom_ground_truth/dependencies/stb"]
path = infinigen/datagen/custom_ground_truth/dependencies/stb
url = https://github.com/nothings/stb.git
[submodule "process_mesh/dependencies/glfw"]
path = process_mesh/dependencies/glfw
[submodule "infinigen/datagen/custom_ground_truth/dependencies/glfw"]
path = infinigen/datagen/custom_ground_truth/dependencies/glfw
url = https://github.com/glfw/glfw.git
22 changes: 11 additions & 11 deletions docs/ConfiguringInfinigen.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This document explains how to configure various features of Infinigen. It assume
## Overview

Generating scenes with Infinigen typically involves two main python scripts:
1. [generate.py](../worldgen/generate.py) - our example scene composition script, which invokes and places assets to create a realistic nature scene.
1. [manage_datagen_jobs.py](../worldgen/tools/manage_datagen_jobs.py) - a script which invokes the above scene composition script many times to generate a useful dataset.
1. [examples/generate_nature.py](../examples/generate_nature.py) - our example scene composition script, which invokes and places assets to create a realistic nature scene.
1. [manage_jobs.py](../infinigen/datagen/manage_jobs.py) - a script which invokes the above scene composition script many times to generate a useful dataset.

`manage_datagen_jobs.py` controls how many and what jobs will be run, and `generate.py` determines what will happen during those jobs. Ultimately both programs must be configured correctly in order to make useful data.

Expand Down Expand Up @@ -47,7 +47,7 @@ Now that you understand the two major python programs and how to configure them,

```
# Original hello world command
python -m tools.manage_datagen_jobs --output_folder outputs/hello_world --num_scenes 1 --specific_seed 0 \
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 Expand Up @@ -156,7 +156,7 @@ Some scene type configs are also generally more expensive than others. `forest.g

### Other `manage_datagen_jobs.py` commandline options

Please run `pythom -m tools.manage_datagen_jobs --help` for an up-to-date description of other commandline arguments. We always use `--cleanup big_files --warmup_sec 30000` for large render jobs. Optionally, you can also log render progress to Weights & Biases.
Please run `pythom -m infinigen.datagen.manage_jobs --help` for an up-to-date description of other commandline arguments. We always use `--cleanup big_files --warmup_sec 30000` for large render jobs. Optionally, you can also log render progress to Weights & Biases.

## Example Commands

Expand All @@ -171,23 +171,23 @@ All commands below are shown with using `local_256GB` config, but you can attemp
Most videos in the "Introducing Infinigen" launch video were made using commands similar to the following:

````
python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scenes 500 \
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 high_quality_terrain
````

#### Creating large-scale stereo datasets

````
python -m tools.manage_datagen_jobs --output_folder outputs/stereo_data --num_scenes 10000 \
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

```
screen python -m tools.manage_datagen_jobs --output_folder outputs/dev --num_scenes 50 \
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 @@ -198,7 +198,7 @@ These commands are intended as inspiration - please read docs above for more adv

<b> Create images that always have rain: </b>
```
python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scenes 500 \
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 \
--overrides compose_scene.rain_particles_chance=1.0
Expand All @@ -208,7 +208,7 @@ python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scen

<b> Create images that only have terrain: </b>
```
python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scenes 500 \
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 @@ -217,7 +217,7 @@ python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scen
<b> Create videos at birds-eye-view camera altitudes: </b>

```
python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scenes 500 \
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 high_quality_terrain \
--overrides camera.camera_pose_proposal.altitude=["uniform", 20, 30]
Expand All @@ -227,7 +227,7 @@ python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scen

<b> Create 1 second video clips: </b>
```
python -m tools.manage_datagen_jobs --output_folder outputs/my_videos --num_scenes 500 \
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 high_quality_terrain \
--pipeline_overrides iterate_scene_tasks.frame_range=[1,25]
Expand Down
8 changes: 4 additions & 4 deletions docs/GeneratingFluidSimulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ To generate fluids, you run install.sh with the optional FLIP-Fluids setup step

#### Generate a video of a single scene with simulated fire generated on the fly
```
python -m tools.manage_datagen_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
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
```
python -m tools.manage_datagen_jobs --specific_seed 1c95bb72 --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=[150,200] --config river.gin simulated_river.gin no_assets.gin no_creatures.gin fast_terrain_assets.gin --cleanup none
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
```
python -m tools.manage_datagen_jobs --output_folder outputs/onthefly --num_scenes 10 \
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
```
python -m tools.manage_datagen_jobs --output_folder /n/fs/pvl-renders/kkayan/river --num_scenes 10 \
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] \
--config simulated_river.gin no_assets.gin no_creatures.gin fast_terrain_assets.gin \
Expand Down
2 changes: 1 addition & 1 deletion docs/GeneratingIndividualAssets.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This tutorial will help you generate images or .blend files of specific assets of your choice.

Limitations (to be addressed soon):
- This tool only exports .blend files. [See here](../worldgen/tools/export/README.md) for a prototype tool to convert these to standard mesh file formats, but it itself has some limitations.
- This tool only exports .blend files. [See here](../infinigen/datagen/tools/export/README.md) for a prototype tool to convert these to standard mesh file formats, but it itself has some limitations.
- This tool cannot currently generate or export terrain meshes.

### Example Commands
Expand Down
2 changes: 1 addition & 1 deletion docs/HelloWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Output logs should indicate what the code is working on. Use `--debug` for even
We provide `tools/manage_datagen_jobs.py`, a utility which runs similar steps automatically.

```
python -m tools.manage_datagen_jobs --output_folder outputs/hello_world --num_scenes 1 --specific_seed 0 \
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions examples/scripts/render_river_video.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TEMP. REMOVE BEFORE MERGE.

HOSTFIRST=$(hostname | tr "." "\n" | head -n 1)
JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1
if [ "$2" = "dev" ]; then
python -m infinigen.datagen.manage_jobs --output_folder $3/$JOBNAME --num_scenes 20 \
--pipeline_config $1 monocular_video_river enable_gpu opengl_gt --wandb_mode online --cleanup none --warmup_sec 12000 --config trailer_river dev reuse_terrain_assets simulated_river
else
python -m infinigen.datagen.manage_jobs --output_folder $3/$JOBNAME --num_scenes 50 \
--pipeline_config $1 monocular_video_river enable_gpu opengl_gt --wandb_mode online --cleanup big_files --warmup_sec 12000 --config trailer_river reuse_terrain_assets simulated_river high_quality_terrain
fi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HOSTFIRST=$(hostname | tr "." "\n" | head -n 1)
JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1

python -m tools.manage_datagen_jobs --output_folder outputs/$JOBNAME \
python -m infinigen.datagen.manage_jobs --output_folder outputs/$JOBNAME \
--num_scenes 100 --pipeline_config $@ stereo_video cuda_terrain opengl_gt_noshortrender \
--wandb_mode online --cleanup big_files \
--warmup_sec 40000 \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HOSTFIRST=$(hostname | tr "." "\n" | head -n 1)
JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1

python -m tools.manage_datagen_jobs --output_folder outputs/$JOBNAME \
python -m infinigen.datagen.manage_jobs --output_folder outputs/$JOBNAME \
--num_scenes 1000 --pipeline_config $@ stereo_video cuda_terrain opengl_gt upload \
--wandb_mode online --cleanup except_crashed --warmup_sec 25000 \
--config high_quality_terrain \
Expand Down
6 changes: 6 additions & 0 deletions examples/scripts/render_video_fire.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TEMP. REMOVE BEFORE MERGE.

HOSTFIRST=$(hostname | tr "." "\n" | head -n 1)
JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1
python -m infinigen.datagen.manage_jobs --output_folder $3/$JOBNAME --num_scenes $2 \
--pipeline_config $1 monocular_video enable_gpu opengl_gt --wandb_mode online --cleanup none --warmup_sec 10000 --config trailer high_quality_terrain reuse_terrain_assets use_on_the_fly_fire
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HOSTFIRST=$(hostname | tr "." "\n" | head -n 1)
JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1

python -m tools.manage_datagen_jobs --output_folder outputs/$JOBNAME \
python -m infinigen.datagen.manage_jobs --output_folder outputs/$JOBNAME \
--num_scenes 1000 --pipeline_config stereo_video $@ cuda_terrain opengl_gt upload \
--wandb_mode online --cleanup except_logs --warmup_sec 35000 \
--configs high_quality_terrain
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions infinigen/assets/debris/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .lichen import LichenFactory
from .moss import MossFactory
from .pine_needle import PineNeedleFactory
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@
import numpy as np
from numpy.random import uniform, normal as N

from assets.utils.decorate import assign_material
from nodes.node_wrangler import Nodes, NodeWrangler
from placement.factory import AssetFactory, make_asset_collection
from placement.instance_scatter import scatter_instances
from surfaces import surface
from placement.factory import AssetFactory
from infinigen_gpl.extras.diff_growth import build_diff_growth
from assets.utils.object import data2mesh
from assets.utils.mesh import polygon_angles
from util import blender as butil
from assets.utils.tag import tag_object, tag_nodegroup
from infinigen.assets.utils.decorate import assign_material
from infinigen.core.nodes.node_wrangler import Nodes, NodeWrangler
from infinigen.core import surface
from infinigen.core.placement.factory import AssetFactory
from infinigen.infinigen_gpl.extras.diff_growth import build_diff_growth
from infinigen.assets.utils.object import data2mesh
from infinigen.assets.utils.mesh import polygon_angles
from infinigen.core.util import blender as butil
from infinigen.assets.utils.tag import tag_object, tag_nodegroup

class LichenFactory(AssetFactory):

Expand Down Expand Up @@ -97,33 +95,4 @@ def create_asset(self, **kwargs):
(self.base_hue + uniform(-.04, .04)) % 1))

tag_object(obj, 'lichen')
return obj


class Lichen:

def __init__(self):
self.fac = LichenFactory(np.random.randint(1e5))
self.col = make_asset_collection(self.fac, name='lichen', n=5)

def apply(self, obj, selection=None):

scatter_obj = scatter_instances(
base_obj=obj, collection=self.col,
density=5e3, min_spacing=.08,
scale=1, scale_rand=N(0.5, 0.07),
selection=selection
)
return scatter_obj


def apply(obj, selection=None):
fac = LichenFactory(np.random.randint(1e5))
col = make_asset_collection(fac, name='lichen', n=5)
scatter_obj = scatter_instances(
base_obj=obj, collection=col,
density=5e3, min_spacing=.08,
scale=1, scale_rand=N(0.5, 0.07),
selection=selection
)
return scatter_obj
return obj
Loading

0 comments on commit 6265e9a

Please sign in to comment.