Skip to content

Commit

Permalink
Hotfix v1.2.3
Browse files Browse the repository at this point in the history
* Fix misplaced opengl path, tweak installation

* Tweak launch scripts

* Fix underspecified child python paths

* Fix cleanup except_crashed

* Fix underspecified child python paths

* Remove cd worldgen typo

* Fix leftover objects in tree generation

* Change version to 1.2.3 not 1.2.0.3
  • Loading branch information
araistrick authored Dec 29, 2023
1 parent 0c622a1 commit 40a2615
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 28 deletions.
4 changes: 2 additions & 2 deletions docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Then, install the following dependencies using the method of your choice. Exampl
sudo apt-get install wget cmake g++ libgles2-mesa-dev libglew-dev libglfw3-dev libglm-dev

# on an Mac ARM (M1/M2/...)
arch -arm64 brew install wget llvm open-mpi libomp glm glew
arch -arm64 brew install wget cmake llvm open-mpi libomp glm glew

# on Mac x86_64 (Intel)
brew install wget llvm open-mpi libomp glm glew
brew install wget cmake llvm open-mpi libomp glm glew
```

### Installation
Expand Down
1 change: 0 additions & 1 deletion docs/PreGeneratedData.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ All pre-generated data released by the Princeton Vision and Learning lab is host
Please run the script below, which will prompt you to determine what ground truth channels, cameras, how many scenes you wish to download.

```bash
cd worldgen
python -m infinigen.tools.download_pregenerated_data outputs/my_download --release_name 2023_10_13_preview
```

Expand Down
2 changes: 1 addition & 1 deletion infinigen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import logging

__version__ = "1.2.0.2"
__version__ = "1.2.3"
30 changes: 20 additions & 10 deletions infinigen/assets/trees/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,20 @@ def create_asset(self, placeholder, face_size, distance, **kwargs) -> bpy.types.
skeleton_obj = placeholder.children[0]

if not self.coarse_mesh_placeholder:
placeholder = self._create_coarse_mesh(skeleton_obj)
self.trunk_surface.apply(placeholder)
butil.parent_to(skeleton_obj, placeholder, no_inverse=True)
placeholder.hide_render = True
skin_obj = self._create_coarse_mesh(skeleton_obj)
self.trunk_surface.apply(skin_obj)
butil.parent_to(skeleton_obj, skin_obj, no_inverse=True)
else:
skin_obj = butil.deep_clone_obj(placeholder)

if self.child_col is not None:
assert self.genome.child_placement is not None

max_needed_child_fs = detail.target_face_size(self.min_dist, global_multiplier=1) if self.min_dist is not None else None
max_needed_child_fs = (
detail.target_face_size(self.min_dist, global_multiplier=1)
if self.min_dist is not None
else None
)

logger.debug(f'adding tree children using {self.child_col=}')
butil.select_none()
Expand All @@ -135,12 +140,15 @@ def create_asset(self, placeholder, face_size, distance, **kwargs) -> bpy.types.
))

if self.camera is not None and distance < self.cam_meshing_max_dist:

assert self.adapt_mesh_method != 'remesh'
skin_obj, outofview, vert_dists, _ = split_inview(placeholder, cam=self.camera, vis_margin=0.15)

skin_obj_cleanup = skin_obj
skin_obj, outofview, vert_dists, _ = split_inview(skin_obj, cam=self.camera, vis_margin=0.15)
butil.parent_to(outofview, skin_obj, no_inverse=True, no_transform=True)

butil.delete(skin_obj_cleanup)
face_size = detail.target_face_size(vert_dists.min())
else:
skin_obj = deep_clone_obj(placeholder, keep_modifiers=True, keep_materials=True)

skin_obj.hide_render = False

Expand All @@ -153,11 +161,13 @@ def create_asset(self, placeholder, face_size, distance, **kwargs) -> bpy.types.
butil.parent_to(skin_obj, placeholder, no_inverse=True, no_transform=True)

if self.realize:

logger.debug(f'realizing tree children')
butil.apply_modifiers(skin_obj)
butil.apply_modifiers(skeleton_obj)
with butil.SelectObjects([skin_obj, skeleton_obj], active=0):
bpy.ops.object.join()

butil.join_objects([skin_obj, skeleton_obj])
assert len(skin_obj.children) == 0
else:
butil.parent_to(skeleton_obj, skin_obj, no_inverse=True)

Expand Down
10 changes: 9 additions & 1 deletion infinigen/core/nodes/node_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,15 @@ class Nodes:
bpy.types.CompositorNodeGroup: Nodes.GroupOutput,
}

DATATYPE_DIMS = {'FLOAT': 1, 'INT': 1, 'FLOAT_VECTOR': 3, 'FLOAT2': 2, 'FLOAT_COLOR': 4, 'BOOLEAN': 1, }
DATATYPE_DIMS = {
'FLOAT': 1,
'INT': 1,
'FLOAT_VECTOR': 3,
'FLOAT2': 2,
'FLOAT_COLOR': 4,
'BOOLEAN': 1,
'INT32_2D': 2
}
DATATYPE_FIELDS = {
'FLOAT': 'value',
'INT': 'value',
Expand Down
4 changes: 3 additions & 1 deletion infinigen/core/placement/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,19 @@ def spawn_asset(self, i, placeholder=None, distance=None, vis_distance=0, loc=(0

obj.name = f'{repr(self)}.spawn_asset({i})'

print(f'{keep_placeholder=} {placeholder.name=} {list(placeholder.children)=} {obj.name=} {list(obj.children)=}')
if keep_placeholder:
if obj is not placeholder:
if obj.parent is None:
butil.parent_to(obj, placeholder, no_inverse=True)
else:
obj.hide_render = False

else:
obj.parent = None
obj.location = placeholder.location
obj.rotation_euler = placeholder.rotation_euler
butil.delete(placeholder)

return obj

__call__ = spawn_asset # for convinience
Expand All @@ -145,6 +146,7 @@ def make_asset_collection(spawn_fns, n, name=None, weights=None, as_list=False,

if verbose:
logger.info(f'Generating collection of {n} assets from {name}')

objs = [[] for _ in range(len(spawn_fns))]
r = trange(n) if verbose else range(n)
for i in r:
Expand Down
16 changes: 11 additions & 5 deletions infinigen/datagen/job_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from functools import partial
from pathlib import Path
from shutil import copytree
import logging
import sys

from infinigen.datagen.util.show_gpu_table import nodes_with_gpus
from infinigen.datagen.util import upload_util
Expand All @@ -23,6 +25,8 @@

from infinigen.core.init import repo_root

logger = logging.getLogger(__name__)

@gin.configurable
def get_cmd(
seed,
Expand All @@ -41,7 +45,7 @@ def get_cmd(
cmd = ''
if process_niceness is not None:
cmd += f'nice -n {process_niceness} '
cmd += 'python '
cmd += f'{sys.executable} '

if driver_script.endswith('.py'):
cmd += driver_script + ' '
Expand Down Expand Up @@ -322,6 +326,10 @@ def queue_mesh_save(
)
return res, output_folder

process_mesh_path = Path(__file__).parent/'customgt'/'build'/'customgt'
if not process_mesh_path.exists():
logger.warning(f'{process_mesh_path=} does not exist, if opengl_gt is enabled it will fail')

@gin.configurable
def queue_opengl(
submit_cmd,
Expand All @@ -342,8 +350,6 @@ def queue_opengl(
return states.JOB_OBJ_SUCCEEDED, None

output_suffix = get_suffix(output_indices)

process_mesh_path = Path(__file__)

input_folder = Path(folder)/f'savemesh{output_suffix}' # OUTPUT SUFFIX IS CORRECT HERE. I know its weird. But input suffix really means 'prev tier of the pipeline
if (gt_testing):
Expand Down Expand Up @@ -371,10 +377,10 @@ def queue_opengl(
]


lines.append(f"python {repo_root()/'infinigen/tools/compress_masks.py'} {output_folder}")
lines.append(f"{sys.executable} {repo_root()/'infinigen/tools/compress_masks.py'} {output_folder}")

lines.append(
f"python -c \"from infinigen.tools.datarelease_toolkit import reorganize_old_framesfolder; "
f"{sys.executable} -c \"from infinigen.tools.datarelease_toolkit import reorganize_old_framesfolder; "
f"reorganize_old_framesfolder({repr(str(output_folder))})\""
)
lines.append(f"touch {folder}/logs/FINISH_{taskname}")
Expand Down
2 changes: 1 addition & 1 deletion infinigen/datagen/monitor_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def apply_cleanup_options(args, seed, crashed, scene_folder):
rmtree(f)
else:
f.unlink()
elif args.cleanup == 'none':
elif args.cleanup == 'none' or (args.cleanup == 'except_crashed' and crashed):
pass
else:
raise ValueError(f'Unrecognized {args.cleanup=} {crashed=}')
Expand Down
2 changes: 1 addition & 1 deletion infinigen/terrain/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def cleanup(self):
for e in self.elements:
self.elements[e].cleanup()

@gin.configurable("export")
@gin.configurable()
def export(self,
dynamic=False,
spherical=True, # false for OcMesher
Expand Down
2 changes: 1 addition & 1 deletion infinigen/tools/submit_asset_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_slurm_banned_nodes(config_path=None):

for asset in args.assets:
for i in range(args.number):
cmd = f"python -m infinigen.asstes.fluid.run_asset_cache -f {args.asset_folder}/ -a {asset} -s {args.start_frame} -d {args.simulation_duration}".split(" ")
cmd = f"{sys.executable} -m infinigen.assets.fluid.run_asset_cache -f {args.asset_folder}/ -a {asset} -s {args.start_frame} -d {args.simulation_duration}".split(" ")
print(cmd)
executor = submitit.AutoExecutor(folder=str(Path(args.asset_folder) / "logs"))
executor.update_parameters(
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/compile_terrain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ cd -

cd ./infinigen/OcMesher
source install.sh
cd -
cd -
2 changes: 1 addition & 1 deletion scripts/install/interactive_blender.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ fi
# Install Blender dependencies
"${BLENDER_PYTHON}" -m ensurepip

CFLAGS="-I/usr/include/python3.10 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -vv -e .
CFLAGS="-I/usr/include/python3.10 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e .
7 changes: 7 additions & 0 deletions scripts/launch/render_stereo_1h.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
HOSTFIRST=$(hostname | tr "." "\n" | head -n 1)
JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1

python -m infinigen.datagen.manage_jobs --output_folder outputs/$JOBNAME \
--num_scenes 10000 --pipeline_config stereo $@ cuda_terrain opengl_gt upload \
--wandb_mode online --cleanup except_crashed --warmup_sec 10000 \
--configs high_quality_terrain
4 changes: 2 additions & 2 deletions scripts/launch/render_video_stereo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ JOBNAME=$(date '+%m_%d_%H_%M').$HOSTFIRST.$1

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 10000 \
--configs high_quality_terrain
--wandb_mode online --cleanup except_crashed --warmup_sec 10000 \
--configs high_quality_terrain video

0 comments on commit 40a2615

Please sign in to comment.