From 34c9a9311d208edae9fe2a4968e817a082fe9439 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 8 Oct 2024 15:16:55 -0400 Subject: [PATCH 01/14] Default to n_stories=1, remove unused hometype gins --- infinigen_examples/configs_indoor/base_indoors.gin | 2 ++ infinigen_examples/configs_indoor/common.gin | 13 ------------- infinigen_examples/configs_indoor/fast_solve.gin | 1 - infinigen_examples/configs_indoor/home.gin | 1 - infinigen_examples/configs_indoor/office.gin | 6 ------ infinigen_examples/configs_indoor/warehouse.gin | 4 ---- 6 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 infinigen_examples/configs_indoor/common.gin delete mode 100644 infinigen_examples/configs_indoor/home.gin delete mode 100644 infinigen_examples/configs_indoor/office.gin delete mode 100644 infinigen_examples/configs_indoor/warehouse.gin diff --git a/infinigen_examples/configs_indoor/base_indoors.gin b/infinigen_examples/configs_indoor/base_indoors.gin index 019c593e..90fd9ac0 100644 --- a/infinigen_examples/configs_indoor/base_indoors.gin +++ b/infinigen_examples/configs_indoor/base_indoors.gin @@ -11,6 +11,8 @@ SimulatedAnnealingSolver.final_temp = 0.001 SimulatedAnnealingSolver.finetune_pct = 0.15 SimulatedAnnealingSolver.max_invalid_candidates = 5 +RoomConstants.n_stories = 1 + configure_render_cycles.num_samples = 16000 animate_cameras.follow_poi_chance=0.0 diff --git a/infinigen_examples/configs_indoor/common.gin b/infinigen_examples/configs_indoor/common.gin deleted file mode 100644 index c7e7ede5..00000000 --- a/infinigen_examples/configs_indoor/common.gin +++ /dev/null @@ -1,13 +0,0 @@ -RoomConstants.n_stories = 1 -execute_tasks.generate_resolution = (1024, 1024) -get_sensor_coords.H = 1024 -get_sensor_coords.W = 1024 - -compose_indoors.terrain_enabled=False -compose_indoors.solve_large_enabled=False -compose_indoors.solve_small_enabled=False -compose_indoors.solve_medium_enabled=False - -compose_scene.topview=True -nishita_lighting.strength = 0.02 -configure_render_cycles.num_samples = 256 diff --git a/infinigen_examples/configs_indoor/fast_solve.gin b/infinigen_examples/configs_indoor/fast_solve.gin index d712c775..4b2c668e 100644 --- a/infinigen_examples/configs_indoor/fast_solve.gin +++ b/infinigen_examples/configs_indoor/fast_solve.gin @@ -1,6 +1,5 @@ FloorPlanSolver.n_divide_trials = 25 FloorPlanSolver.iters_mult = 25 -RoomConstants.n_stories = 1 GraphMaker.fast=True home_room_constraints.fast = True diff --git a/infinigen_examples/configs_indoor/home.gin b/infinigen_examples/configs_indoor/home.gin deleted file mode 100644 index 344bd3dc..00000000 --- a/infinigen_examples/configs_indoor/home.gin +++ /dev/null @@ -1 +0,0 @@ -include 'infinigen_examples/configs_indoor/common.gin' diff --git a/infinigen_examples/configs_indoor/office.gin b/infinigen_examples/configs_indoor/office.gin deleted file mode 100644 index 3b6a00a9..00000000 --- a/infinigen_examples/configs_indoor/office.gin +++ /dev/null @@ -1,6 +0,0 @@ -include 'infinigen_examples/configs_indoor/common.gin' -compose_scene.type = 'office' -compose_scene.topview_rot_x=45 -compose_scene.topview_rot_z=-45 -restrict_solving.restrict_parent_rooms = ('OpenOffice', ) - diff --git a/infinigen_examples/configs_indoor/warehouse.gin b/infinigen_examples/configs_indoor/warehouse.gin deleted file mode 100644 index b9efbafe..00000000 --- a/infinigen_examples/configs_indoor/warehouse.gin +++ /dev/null @@ -1,4 +0,0 @@ -include 'infinigen_examples/configs_indoor/common.gin' -compose_scene.type = 'warehouse' -RoomConstants.global_params.wall_height = ('uniform', 5.6, 6.4) -restrict_solving.restrict_parent_rooms = ('Warehouse', ) \ No newline at end of file From 8bc75f67e4e60e3f9cbb1310c84fdc5ada95963d Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 8 Oct 2024 18:41:03 -0400 Subject: [PATCH 02/14] Add action=append for argparse for all configs, overrides, pipeline_overrides etc, to avoid silent failure if specified twice e.g. #336 #303 --- infinigen/datagen/manage_jobs.py | 5 +++++ infinigen/tools/download_pregenerated_data.py | 3 +++ infinigen/tools/submit_asset_cache.py | 1 + infinigen_examples/generate_individual_assets.py | 5 +++-- infinigen_examples/generate_indoors.py | 5 ++++- infinigen_examples/generate_nature.py | 3 +++ 6 files changed, 19 insertions(+), 3 deletions(-) diff --git a/infinigen/datagen/manage_jobs.py b/infinigen/datagen/manage_jobs.py index 407ea030..8d19bae6 100644 --- a/infinigen/datagen/manage_jobs.py +++ b/infinigen/datagen/manage_jobs.py @@ -771,6 +771,7 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N "--specific_seed", default=None, nargs="+", + action="append", help="The default, None, will choose a random seed per scene. Otherwise, all " "scenes will have the specified seed. Interpreted as an integer if possible.", ) @@ -798,6 +799,7 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N parser.add_argument( "--configs", nargs="*", + action="append", default=[], help="List of gin config names to pass through to all underlying " "scene generation jobs.", @@ -806,6 +808,7 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N "-p", "--overrides", nargs="+", + action="append", type=str, default=[], help="List of gin overrides to pass through to all underlying " @@ -822,12 +825,14 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N "--pipeline_configs", type=str, nargs="+", + action="append", help="List of gin config names from tools/pipeline_configs " "to configure this execution", ) parser.add_argument( "--pipeline_overrides", nargs="+", + action="append", type=str, default=[], help="List of gin overrides to configure this execution", diff --git a/infinigen/tools/download_pregenerated_data.py b/infinigen/tools/download_pregenerated_data.py index 69e73826..4b50bd14 100644 --- a/infinigen/tools/download_pregenerated_data.py +++ b/infinigen/tools/download_pregenerated_data.py @@ -290,6 +290,7 @@ def main(args): "--seeds", type=str, nargs="+", + action="append", default=None, help="What scenes should we download? Omit to download all available in this release", ) @@ -297,6 +298,7 @@ def main(args): "--cameras", type=str, nargs="+", + action="append", default=None, help="What cameras should we download data for? Omit to download all available in this release", ) @@ -304,6 +306,7 @@ def main(args): "--data_types", type=str, nargs="+", + action="append", default=None, help="What data types (e.g Image, Depth, etc) should we download data for? Omit to download all available in this release", ) diff --git a/infinigen/tools/submit_asset_cache.py b/infinigen/tools/submit_asset_cache.py index fb1bb259..2e5131c8 100644 --- a/infinigen/tools/submit_asset_cache.py +++ b/infinigen/tools/submit_asset_cache.py @@ -26,6 +26,7 @@ def get_slurm_banned_nodes(config_path=None): "-a", "--assets", nargs="+", + action="append", default=[ "CachedBushFactory", "CachedTreeFactory", diff --git a/infinigen_examples/generate_individual_assets.py b/infinigen_examples/generate_individual_assets.py index bcc7b810..b135ebfe 100644 --- a/infinigen_examples/generate_individual_assets.py +++ b/infinigen_examples/generate_individual_assets.py @@ -484,8 +484,7 @@ def main(args): if len(factories) == 1 and factories[0].endswith(".txt"): factories = [ - f.split(".")[-1] - for f in load_txt_list(factories[0], skip_sharp=False) + f.split(".")[-1] for f in load_txt_list(factories[0], skip_sharp=False) ] else: assert not any(f.endswith(".txt") for f in factories) @@ -671,6 +670,7 @@ def make_args(): "--configs", type=str, nargs="+", + action="append", default=[], help="List of gin config files to apply", ) @@ -678,6 +678,7 @@ def make_args(): "--overrides", type=str, nargs="+", + action="append", default=[], help="List of gin overrides to apply", ) diff --git a/infinigen_examples/generate_indoors.py b/infinigen_examples/generate_indoors.py index 129d9a8c..2b04dd46 100644 --- a/infinigen_examples/generate_indoors.py +++ b/infinigen_examples/generate_indoors.py @@ -522,6 +522,7 @@ def main(args): "-t", "--task", nargs="+", + action="append", default=["coarse"], choices=[ "coarse", @@ -537,7 +538,8 @@ def main(args): "-g", "--configs", nargs="+", - default=["base"], + action="append", + default=[], help="Set of config files for gin (separated by spaces) " "e.g. --gin_config file1 file2 (exclude .gin from path)", ) @@ -545,6 +547,7 @@ def main(args): "-p", "--overrides", nargs="+", + action="append", default=[], help="Parameter settings that override config defaults " "e.g. --gin_param module_1.a=2 module_2.b=3", diff --git a/infinigen_examples/generate_nature.py b/infinigen_examples/generate_nature.py index 8f689dc6..062520b8 100644 --- a/infinigen_examples/generate_nature.py +++ b/infinigen_examples/generate_nature.py @@ -982,6 +982,7 @@ def main(args): "-t", "--task", nargs="+", + action="append", default=["coarse"], choices=[ "coarse", @@ -997,6 +998,7 @@ def main(args): "-g", "--configs", nargs="+", + action="append", default=["base"], help="Set of config files for gin (separated by spaces) " "e.g. --gin_config file1 file2 (exclude .gin from path)", @@ -1005,6 +1007,7 @@ def main(args): "-p", "--overrides", nargs="+", + action="append", default=[], help="Parameter settings that override config defaults " "e.g. --gin_param module_1.a=2 module_2.b=3", From 4a6067835c8a59a3f616e69207eb35ae7b767ecd Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 8 Oct 2024 14:45:44 -0400 Subject: [PATCH 03/14] Add .nfs lockfiles to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 254321a6..c63bc14d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ blender blender.tar.xz Blender.app +.nfs* + *.c .coverage From 7fd1d6d461f1dc79cbf8328e4d77d5714c30ad3f Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 8 Oct 2024 14:46:06 -0400 Subject: [PATCH 04/14] Fix name_ fields for integration parse --- tests/integration/integration_test_parse_logs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/integration_test_parse_logs.py b/tests/integration/integration_test_parse_logs.py index a3084216..ef49ecc5 100644 --- a/tests/integration/integration_test_parse_logs.py +++ b/tests/integration/integration_test_parse_logs.py @@ -327,10 +327,13 @@ def main(): if args.nearest: main_df = fuzzy_merge(lhs, rhs, keyA="name", keyB="name", threshold=80) - main_df["name_A"] = main_df["name"] - main_df["name_B"] = main_df["name"] else: main_df = lhs.merge(rhs, on="name", suffixes=("_A", "_B"), how="outer") + main_df["name_A"] = main_df["name"] + main_df["name_B"] = main_df["name"] + + assert "name_A" in main_df.columns + assert "name_B" in main_df.columns for col in main_df: if col.startswith("img_path"): From fb2905c305778de821ccfdba86bb6f3fcfc6981a Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Wed, 9 Oct 2024 14:34:21 -0400 Subject: [PATCH 05/14] Rename to launch.sh and compare.py, make inputs be direct paths --- ...egration_test_parse_logs.py => compare.py} | 59 +++++++++---------- .../{integration_test_launch.sh => launch.sh} | 14 +++-- 2 files changed, 38 insertions(+), 35 deletions(-) rename tests/integration/{integration_test_parse_logs.py => compare.py} (89%) rename tests/integration/{integration_test_launch.sh => launch.sh} (89%) diff --git a/tests/integration/integration_test_parse_logs.py b/tests/integration/compare.py similarity index 89% rename from tests/integration/integration_test_parse_logs.py rename to tests/integration/compare.py index ef49ecc5..eca7c474 100644 --- a/tests/integration/integration_test_parse_logs.py +++ b/tests/integration/compare.py @@ -53,15 +53,11 @@ def parse_scene_log( "blendergt": [], } - log_folder = scene_path/"logs" - coarse_folder = scene_path/"coarse" - fine_folder = scene_path/"fine" - - if not ( - log_folder.exists() - and coarse_folder.exists() - and fine_folder.exists() - ): + log_folder = scene_path / "logs" + coarse_folder = scene_path / "coarse" + fine_folder = scene_path / "fine" + + if not (log_folder.exists() and coarse_folder.exists() and fine_folder.exists()): return ret_dict for filepath in log_folder.glob("*.err"): @@ -133,11 +129,12 @@ def parse_scene_log( "gt_time": gt_time, } - fine_poly = parse_poly_file(fine_folder/"polycounts.txt") + fine_poly = parse_poly_file(fine_folder / "polycounts.txt") ret_dict["gen_triangles"] = fine_poly.get("Triangles", "NAN") return ret_dict + def parse_poly_file(path): res = {} @@ -153,18 +150,20 @@ def parse_poly_file(path): return res -def parse_asset_log(asset_path): - poly = parse_poly_file(asset_path/"polycounts.txt") +def parse_asset_log(asset_path): + poly = parse_poly_file(asset_path / "polycounts.txt") return { "triangles": poly.get("Tris", "NAN"), "gen_mem": poly.get("Memory", "NAN"), } + def format_stats(d): return ", ".join(f"{k}: {v}" for k, v in d.items()) + def parse_run_df(run_path: Path): runs = { "_".join((x.name.split("_")[2:])): x for x in run_path.iterdir() if x.is_dir() @@ -255,16 +254,14 @@ def find_run(base_path: str, run: str) -> Path: def fuzzy_merge(dfA, dfB, keyA, keyB, threshold=1): - from rapidfuzz import fuzz, process matches_A = [] matches_B = [] - def preproc(x): - x = x.split('/')[-1] - x = re.sub(r'(? Date: Tue, 15 Oct 2024 18:01:47 -0400 Subject: [PATCH 06/14] Fix window orientations --- infinigen/assets/utils/shapes.py | 2 +- .../constraints/constraint_language/constants.py | 2 +- .../core/constraints/example_solver/room/contour.py | 6 ++++-- .../constraints/example_solver/room/solidifier.py | 4 +++- .../core/constraints/example_solver/room/utils.py | 12 ++++++++++++ .../core/constraints/example_solver/state_def.py | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/infinigen/assets/utils/shapes.py b/infinigen/assets/utils/shapes.py index f9dc7575..82f35671 100644 --- a/infinigen/assets/utils/shapes.py +++ b/infinigen/assets/utils/shapes.py @@ -121,7 +121,7 @@ def obj2polygon(obj): for p in obj.data.polygons ] ) - return shapely.make_valid(shapely.simplify(p, 1e-6)) + return shapely.ops.orient(shapely.make_valid(shapely.simplify(p, 1e-6))) def buffer(p, distance): diff --git a/infinigen/core/constraints/constraint_language/constants.py b/infinigen/core/constraints/constraint_language/constants.py index 5704f709..c1178da5 100644 --- a/infinigen/core/constraints/constraint_language/constants.py +++ b/infinigen/core/constraints/constraint_language/constants.py @@ -150,7 +150,7 @@ def canonicalize(self, p): break if not is_valid_polygon(p): raise NotImplementedError("Invalid polygon") - return p + return orient(p) except AttributeError: raise NotImplementedError("Invalid multi polygon") diff --git a/infinigen/core/constraints/example_solver/room/contour.py b/infinigen/core/constraints/example_solver/room/contour.py index 7d822ad2..4a7277f1 100644 --- a/infinigen/core/constraints/example_solver/room/contour.py +++ b/infinigen/core/constraints/example_solver/room/contour.py @@ -142,12 +142,14 @@ def decorate(self, state): quad_segs = ( 1 if corner_func == "sharp" else np.random.randint(4, 7) ) - exterior_ = ( + exterior_ = self.constants.canonicalize( exterior.difference(cutter) .union(shapely.Point(q).buffer(length, quad_segs=quad_segs)) .buffer(0) ) - new = state[k].polygon.intersection(exterior_).buffer(0) + new = self.constants.canonicalize( + state[k].polygon.intersection(exterior_).buffer(0) + ) if all( new.buffer(-m + 1e-2).geom_type == "Polygon" for m in np.linspace(0, 0.75, 4) diff --git a/infinigen/core/constraints/example_solver/room/solidifier.py b/infinigen/core/constraints/example_solver/room/solidifier.py index 82215d7c..27a6f733 100644 --- a/infinigen/core/constraints/example_solver/room/solidifier.py +++ b/infinigen/core/constraints/example_solver/room/solidifier.py @@ -42,6 +42,7 @@ from infinigen.core.util.random import random_general as rg from .base import RoomGraph, room_type, valid_rooms +from .utils import mls_ccw logger = logging.getLogger(__name__) @@ -210,7 +211,8 @@ def solidify(self, state): } exterior = next(k for k in state.objs if room_type(k) == Semantics.Exterior) exterior_edges = { - r.target_name: canonicalize_mls(r.value) for r in state[exterior].relations + r.target_name: mls_ccw(canonicalize_mls(r.value), state, r.target_name) + for r in state[exterior].relations } exterior_buffer = shapely.simplify( state[exterior].polygon.buffer(-wt / 2 - _eps, join_style="mitre"), 1e-3 diff --git a/infinigen/core/constraints/example_solver/room/utils.py b/infinigen/core/constraints/example_solver/room/utils.py index 84da9855..960d8218 100644 --- a/infinigen/core/constraints/example_solver/room/utils.py +++ b/infinigen/core/constraints/example_solver/room/utils.py @@ -50,6 +50,18 @@ def update_exterior(state: State, i: str): r.value = MultiLineString(v) +def mls_ccw(mls: MultiLineString, state: State, i: str): + exterior = state[i].polygon.exterior + coords = np.array(exterior.coords[:-1]) + mls_ = [] + for ls in mls.geoms: + u, v = ls.coords[:2] + x = np.argmin(np.linalg.norm(coords - np.array(u)[np.newaxis], axis=-1)) + y = np.argmin(np.linalg.norm(coords - np.array(v)[np.newaxis], axis=-1)) + mls_.append(ls if x < y else shapely.reverse(ls)) + return MultiLineString(mls_) + + def update_staircase(state: State, i: str): pholder = room_name(Semantics.Staircase, room_level(i)) r = next(r for r in state[pholder].relations if r.target_name == i) diff --git a/infinigen/core/constraints/example_solver/state_def.py b/infinigen/core/constraints/example_solver/state_def.py index 3ede7e61..3754b311 100644 --- a/infinigen/core/constraints/example_solver/state_def.py +++ b/infinigen/core/constraints/example_solver/state_def.py @@ -74,7 +74,7 @@ def __repr__(self): obj = self.obj tags = self.tags relations = self.relations - return f"{self.__class__.__name__}(obj.name={obj.name if obj is not None else obj.name}, polygon={self.polygon}, {tags=}, {relations=})" + return f"{self.__class__.__name__}(obj.name={obj.name if obj is not None else None}, polygon={self.polygon}, {tags=}, {relations=})" @dataclass From 378c95c5a68d86138ea4a525d842db0d8fc33f6c Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Wed, 16 Oct 2024 05:36:49 -0400 Subject: [PATCH 07/14] Fix asset framing --- infinigen_examples/generate_individual_assets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infinigen_examples/generate_individual_assets.py b/infinigen_examples/generate_individual_assets.py index bcc7b810..cd954dcf 100644 --- a/infinigen_examples/generate_individual_assets.py +++ b/infinigen_examples/generate_individual_assets.py @@ -290,8 +290,9 @@ def build_and_save_asset(payload: dict): ) if args.cam_center > 0 and asset: - co = read_base_co(asset) + asset.location - center.location = (np.amin(co, 0) + np.amax(co, 0)) / 2 + co = read_base_co(asset) + location = (np.amin(co, 0) + np.amax(co, 0)) / 2 + center.location = (np.array(asset.matrix_world) @ np.array([*location, 1]))[:-1] center.location[-1] += args.cam_zoff if args.cam_dist <= 0 and asset: From c64131164bba645f6ed798799d0b13ca89d2a4c7 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Wed, 16 Oct 2024 17:31:05 -0400 Subject: [PATCH 08/14] Fix door cutter intersection. --- infinigen/core/constraints/example_solver/room/solidifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infinigen/core/constraints/example_solver/room/solidifier.py b/infinigen/core/constraints/example_solver/room/solidifier.py index 27a6f733..0077cba3 100644 --- a/infinigen/core/constraints/example_solver/room/solidifier.py +++ b/infinigen/core/constraints/example_solver/room/solidifier.py @@ -540,7 +540,7 @@ def make_door_cutter(self, mls, direction): wt = self.constants.wall_thickness cutter.scale = ( self.constants.door_width / 2, - self.constants.door_width / 2 + wt, + self.constants.door_width + wt / 2, self.constants.door_size / 2 - _snap / 2, ) cutter.location[-1] += _snap / 2 From d971819836e1614aeeb215c34db9c6240b0d689e Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Thu, 17 Oct 2024 02:49:41 -0400 Subject: [PATCH 09/14] Fix wall deterministic issue --- infinigen/core/constraints/example_solver/room/decorate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infinigen/core/constraints/example_solver/room/decorate.py b/infinigen/core/constraints/example_solver/room/decorate.py index 909c04a4..a567f575 100644 --- a/infinigen/core/constraints/example_solver/room/decorate.py +++ b/infinigen/core/constraints/example_solver/room/decorate.py @@ -45,7 +45,7 @@ from infinigen.core.surface import write_attr_data from infinigen.core.util import blender as butil from infinigen.core.util.blender import deep_clone_obj -from infinigen.core.util.math import int_hash +from infinigen.core.util.math import FixedSeed, int_hash from infinigen.core.util.random import log_uniform from infinigen.core.util.random import random_general as rg @@ -93,7 +93,7 @@ def split_rooms(rooms_meshed: list[bpy.types.Object]): def import_material(factory_name): - with gin.unlock_config(): + with gin.unlock_config(), FixedSeed(0): try: return importlib.import_module(f"infinigen.assets.materials.{factory_name}") except ImportError: From f6c312d140c718523e2ab4eabbc1b5bf1735a2c8 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 8 Oct 2024 14:03:00 -0400 Subject: [PATCH 10/14] Move gin initialization inside slurm-submitted function, so slurm jobs recieve gin configs --- .../generate_individual_assets.py | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/infinigen_examples/generate_individual_assets.py b/infinigen_examples/generate_individual_assets.py index 6762b5b2..a4c85796 100644 --- a/infinigen_examples/generate_individual_assets.py +++ b/infinigen_examples/generate_individual_assets.py @@ -236,6 +236,25 @@ def build_and_save_asset(payload: dict): output_folder.mkdir(exist_ok=True) + init.apply_gin_configs( + ["infinigen_examples/configs_indoor", "infinigen_examples/configs_nature"], + configs=args.configs, + overrides=args.overrides, + skip_unknown=True, + ) + + if args.debug is not None: + for name in logging.root.manager.loggerDict: + if not name.startswith("infinigen"): + continue + if len(args.debug) == 0 or any(name.endswith(x) for x in args.debug): + logging.getLogger(name).setLevel(logging.DEBUG) + + init.configure_blender() + + if args.gpu: + init.configure_render_cycles() + logger.info(f"Building scene for {factory_name} {idx}") if args.seed > 0: @@ -454,25 +473,6 @@ def mapfunc( def main(args): bpy.context.window.workspace = bpy.data.workspaces["Geometry Nodes"] - init.apply_gin_configs( - ["infinigen_examples/configs_indoor", "infinigen_examples/configs_nature"], - configs=args.configs, - overrides=args.overrides, - skip_unknown=True, - ) - - if args.debug is not None: - for name in logging.root.manager.loggerDict: - if not name.startswith("infinigen"): - continue - if len(args.debug) == 0 or any(name.endswith(x) for x in args.debug): - logging.getLogger(name).setLevel(logging.DEBUG) - - init.configure_blender() - - if args.gpu: - init.configure_render_cycles() - if args.output_folder is None: outputs = Path("outputs") assert outputs.exists(), outputs From 2bfad931808e4cc9326bb29f25ee3f0949ef5b56 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Wed, 28 Aug 2024 12:59:41 -0400 Subject: [PATCH 11/14] Fix wandb alert title overflow, fix show_gpu_table account names --- infinigen/datagen/manage_jobs.py | 2 +- infinigen/datagen/util/show_gpu_table.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infinigen/datagen/manage_jobs.py b/infinigen/datagen/manage_jobs.py index 8d19bae6..0e82bfa4 100644 --- a/infinigen/datagen/manage_jobs.py +++ b/infinigen/datagen/manage_jobs.py @@ -679,7 +679,7 @@ def manage_datagen_jobs(all_scenes, elapsed, num_concurrent, disk_sleep_threshol print(message) if wandb is not None: wandb.alert( - title=f"{args.output_folder} full", + title=f"{args.output_folder.name} sleeping for full disk", text=message, wait_duration=3 * 60 * 60, ) diff --git a/infinigen/datagen/util/show_gpu_table.py b/infinigen/datagen/util/show_gpu_table.py index e8aaf0a5..87bb92dd 100644 --- a/infinigen/datagen/util/show_gpu_table.py +++ b/infinigen/datagen/util/show_gpu_table.py @@ -35,7 +35,7 @@ def get_gpu_nodes(): for line in sinfo_output.splitlines(): node, group, gres, totalmem = line.split() if group != "all": - if group in {"pvl", "cs*"}: + if group in {"pvl", "cs*", "pnlp"}: num_cpus = int(cpu_regex(gres).group(1)) shared_node_mem[node] = int((int(totalmem) / 1024) / num_cpus) if gres_regex(gres): From bde8d48912d7b5568d0114e06a7588d4241e1c86 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Tue, 8 Oct 2024 22:16:49 -0400 Subject: [PATCH 12/14] Reduce bottles and other tablewares to correct face size =5e-3 and reduce poly counts --- infinigen/assets/objects/bathroom/toilet.py | 4 +- infinigen/assets/objects/monocot/banana.py | 2 + infinigen/assets/objects/monocot/veratrum.py | 2 +- infinigen/assets/objects/mushroom/cap.py | 2 +- .../assets/objects/seating/chairs/chair.py | 8 ++- infinigen/assets/objects/tableware/bottle.py | 1 - infinigen/assets/objects/tableware/bowl.py | 9 ++-- infinigen/assets/objects/tableware/cup.py | 8 +-- infinigen/assets/objects/tableware/jar.py | 2 +- infinigen/assets/objects/tableware/knife.py | 1 + infinigen/assets/objects/tableware/plate.py | 10 ++-- .../assets/objects/tableware/wineglass.py | 5 +- infinigen/assets/utils/draw.py | 53 ++++++++++++------- 13 files changed, 59 insertions(+), 48 deletions(-) diff --git a/infinigen/assets/objects/bathroom/toilet.py b/infinigen/assets/objects/bathroom/toilet.py index dc7ebee0..6e6d8701 100644 --- a/infinigen/assets/objects/bathroom/toilet.py +++ b/infinigen/assets/objects/bathroom/toilet.py @@ -139,7 +139,7 @@ def make_tube(self, lower, upper): bpy.ops.mesh.select_mode(type="EDGE") bpy.ops.mesh.select_all(action="SELECT") bpy.ops.mesh.bridge_edge_loops( - number_cuts=np.random.randint(12, 16), + number_cuts=64, profile_shape_factor=uniform(0.1, 0.2), interpolation="SURFACE", ) @@ -242,7 +242,7 @@ def make_stand(self, obj, bottom): bpy.ops.mesh.select_mode(type="EDGE") bpy.ops.mesh.select_all(action="SELECT") bpy.ops.mesh.bridge_edge_loops( - number_cuts=np.random.randint(12, 16), + number_cuts=64, profile_shape_factor=uniform(0.0, 0.15), ) return stand diff --git a/infinigen/assets/objects/monocot/banana.py b/infinigen/assets/objects/monocot/banana.py index ef581102..abc24856 100644 --- a/infinigen/assets/objects/monocot/banana.py +++ b/infinigen/assets/objects/monocot/banana.py @@ -12,6 +12,7 @@ from infinigen.assets.utils.draw import bezier_curve, leaf from infinigen.assets.utils.nodegroup import geo_radius from infinigen.assets.utils.object import join_objects, origin2lowest +from infinigen.assets.utils.shapes import point_normal_up from infinigen.core import surface from infinigen.core.tagging import tag_object from infinigen.core.util import blender as butil @@ -134,6 +135,7 @@ def __init__(self, factory_seed, coarse=False): self.max_y_angle = uniform(-np.pi * 0.05, 0) def displace_veins(self, obj): + point_normal_up(obj) vg = obj.vertex_groups.new(name="distance") x, y, z = read_co(obj).T branch = np.cos( diff --git a/infinigen/assets/objects/monocot/veratrum.py b/infinigen/assets/objects/monocot/veratrum.py index 77f3d539..64208baa 100644 --- a/infinigen/assets/objects/monocot/veratrum.py +++ b/infinigen/assets/objects/monocot/veratrum.py @@ -163,7 +163,7 @@ def build_leaf(self, face_size): [0, 2, 4], dupli=True, loop=True, - resolution=np.random.randint(3, 5), + rotation_resolution=np.random.randint(3, 5), axis=(1, 0, 0), ) butil.modify_mesh(obj, "WELD", merge_threshold=face_size / 2) diff --git a/infinigen/assets/objects/mushroom/cap.py b/infinigen/assets/objects/mushroom/cap.py index 04dc8fd7..b44e55d1 100644 --- a/infinigen/assets/objects/mushroom/cap.py +++ b/infinigen/assets/objects/mushroom/cap.py @@ -313,7 +313,7 @@ def create_asset(self, face_size, **params) -> bpy.types.Object: gill_config["vector_locations"], dupli=True, loop=True, - resolution=np.random.randint(8, 20), + rotation_resolution=np.random.randint(8, 20), ) subsurface2face_size(gill, face_size) assign_material(gill, self.material) diff --git a/infinigen/assets/objects/seating/chairs/chair.py b/infinigen/assets/objects/seating/chairs/chair.py index ffce7f90..80208e7b 100644 --- a/infinigen/assets/objects/seating/chairs/chair.py +++ b/infinigen/assets/objects/seating/chairs/chair.py @@ -226,7 +226,7 @@ def make_seat(self): * self.thickness ) vector_locations = [1, 7] if self.is_seat_round else [1, 3, 5, 7] - obj = bezier_curve((x_anchors, y_anchors, z_anchors), vector_locations, 8) + obj = bezier_curve((x_anchors, y_anchors, z_anchors), vector_locations) with butil.ViewportMode(obj, "EDIT"): bpy.ops.mesh.select_all(action="SELECT") bpy.ops.mesh.fill_grid(use_interp_simple=True) @@ -260,9 +260,7 @@ def make_limb(self, leg_ends, leg_starts): case _: axes = None scale = None - limb = align_bezier( - np.stack([leg_start, leg_end], -1), axes, scale, resolution=64 - ) + limb = align_bezier(np.stack([leg_start, leg_end], -1), axes, scale) limb.location = ( np.array( [ @@ -335,7 +333,7 @@ def make_back_decors(self, backs, finalize=True): & (center[:, -1] <= z_max * self.back_height), ) bpy.ops.mesh.bridge_edge_loops( - number_cuts=32, + number_cuts=64, interpolation="LINEAR", smoothness=smoothness, profile_shape_factor=profile_shape_factor, diff --git a/infinigen/assets/objects/tableware/bottle.py b/infinigen/assets/objects/tableware/bottle.py index 8b32d70d..67b9c82f 100644 --- a/infinigen/assets/objects/tableware/bottle.py +++ b/infinigen/assets/objects/tableware/bottle.py @@ -198,7 +198,6 @@ def make_bottle(self): z_anchors = np.array(self.z_anchors) * self.z_length anchors = x_anchors, 0, z_anchors obj = spin(anchors, np.nonzero(self.is_vector)[0]) - subsurf(obj, 1, True) subsurf(obj, 1) if self.bottle_width > 0: butil.modify_mesh(obj, "SOLIDIFY", thickness=self.bottle_width) diff --git a/infinigen/assets/objects/tableware/bowl.py b/infinigen/assets/objects/tableware/bowl.py index d260eb91..6dcefe5f 100644 --- a/infinigen/assets/objects/tableware/bowl.py +++ b/infinigen/assets/objects/tableware/bowl.py @@ -27,9 +27,9 @@ def __init__(self, factory_seed, coarse=False): self.x_bottom = uniform(0.2, 0.3) * self.x_end self.x_mid = uniform(0.8, 0.95) * self.x_end self.has_guard = False - self.thickness = uniform(0.01, 0.03) self.has_inside = uniform(0, 1) < 0.5 self.scale = log_uniform(0.15, 0.4) + self.thickness = uniform(0.01, 0.03) * self.scale self.edge_wear = None def create_placeholder(self, **kwargs) -> bpy.types.Object: @@ -46,15 +46,12 @@ def create_asset(self, **params) -> bpy.types.Object: self.x_end, ) z_anchors = 0, 0, 0, self.z_bottom, self.z_length / 2, self.z_length - anchors = x_anchors, np.zeros_like(x_anchors), z_anchors - obj = spin(anchors, [2, 3], 16, 64) - subsurf(obj, 1) + anchors = np.array(x_anchors) * self.scale, 0, np.array(z_anchors) * self.scale + obj = spin(anchors, [2, 3]) self.solidify_with_inside(obj, self.thickness) butil.modify_mesh( obj, "BEVEL", width=self.thickness / 2, segments=np.random.randint(2, 5) ) - obj.scale = [self.scale] * 3 - butil.apply_transform(obj) subsurf(obj, 1) set_shade_smooth(obj) return obj diff --git a/infinigen/assets/objects/tableware/cup.py b/infinigen/assets/objects/tableware/cup.py index ffaeed97..6f424cec 100644 --- a/infinigen/assets/objects/tableware/cup.py +++ b/infinigen/assets/objects/tableware/cup.py @@ -79,9 +79,10 @@ def create_asset(self, **params) -> bpy.types.Object: self.x_end, ) z_anchors = 0, 0, self.depth * 0.5, self.depth - anchors = x_anchors, np.zeros_like(x_anchors), z_anchors - obj = spin(anchors, [1], 16) - subsurf(obj, 1) + anchors = np.array(x_anchors) * self.scale, 0, np.array(z_anchors) * self.scale + obj = spin(anchors, [1]) + obj.scale = [1 / self.scale] * 3 + butil.apply_transform(obj, True) butil.modify_mesh( obj, "BEVEL", @@ -95,6 +96,7 @@ def create_asset(self, **params) -> bpy.types.Object: else: wrap = None self.solidify_with_inside(obj, self.thickness) + subsurf(obj, 2) handle_location = ( x_anchors[-2] * (1 - self.handle_location) + x_anchors[-1] * self.handle_location, diff --git a/infinigen/assets/objects/tableware/jar.py b/infinigen/assets/objects/tableware/jar.py index 1f46f7d1..f8ec3285 100644 --- a/infinigen/assets/objects/tableware/jar.py +++ b/infinigen/assets/objects/tableware/jar.py @@ -67,7 +67,7 @@ def create_asset(self, **params) -> bpy.types.Object: bpy.ops.mesh.extrude_edges_move( TRANSFORM_OT_translate={"value": (0, 0, self.z_cap * self.z_length)} ) - subsurf(obj, 1) + subsurf(obj, 2) butil.modify_mesh(obj, "SOLIDIFY", thickness=self.thickness) cap = new_cylinder(vertices=64) diff --git a/infinigen/assets/objects/tableware/knife.py b/infinigen/assets/objects/tableware/knife.py index c4515e23..6be6cbdd 100644 --- a/infinigen/assets/objects/tableware/knife.py +++ b/infinigen/assets/objects/tableware/knife.py @@ -108,6 +108,7 @@ def selection(nw, x): selection = self.make_double_sided(selection) self.add_guard(obj, selection) subsurf(obj, 1) + subsurf(obj, 1, True) obj.scale = [self.scale] * 3 butil.apply_transform(obj) return obj diff --git a/infinigen/assets/objects/tableware/plate.py b/infinigen/assets/objects/tableware/plate.py index 461b78f4..048aadad 100644 --- a/infinigen/assets/objects/tableware/plate.py +++ b/infinigen/assets/objects/tableware/plate.py @@ -26,21 +26,19 @@ def __init__(self, factory_seed, coarse=False): self.z_mid = uniform(0.3, 0.8) * self.z_length self.has_guard = False self.pre_level = 1 - self.thickness = uniform(0.01, 0.03) self.has_inside = uniform(0, 1) < 0.2 self.scale = log_uniform(0.2, 0.4) + self.thickness = uniform(0.01, 0.03) * self.scale self.scratch = self.edge_wear = None def create_asset(self, **params) -> bpy.types.Object: x_anchors = 0, self.x_mid, self.x_mid, self.x_end z_anchors = 0, 0, self.z_mid, self.z_length - anchors = x_anchors, np.zeros_like(x_anchors), z_anchors - obj = spin(anchors, [1, 2], 4, 16) + anchors = np.array(x_anchors) * self.scale, 0, np.array(z_anchors) * self.scale + obj = spin(anchors, [1, 2]) butil.modify_mesh( obj, "SUBSURF", render_levels=self.pre_level, levels=self.pre_level ) self.solidify_with_inside(obj, self.thickness) - subsurf(obj, 2) - obj.scale = [self.scale] * 3 - butil.apply_transform(obj) + subsurf(obj, 1) return obj diff --git a/infinigen/assets/objects/tableware/wineglass.py b/infinigen/assets/objects/tableware/wineglass.py index 07dd8890..ea3ce4fc 100644 --- a/infinigen/assets/objects/tableware/wineglass.py +++ b/infinigen/assets/objects/tableware/wineglass.py @@ -8,7 +8,6 @@ from infinigen.assets.materials import glass from infinigen.assets.objects.tableware.base import TablewareFactory -from infinigen.assets.utils.decorate import subsurf from infinigen.assets.utils.draw import spin from infinigen.core.util import blender as butil from infinigen.core.util.math import FixedSeed @@ -43,10 +42,8 @@ def create_asset(self, **params) -> bpy.types.Object: ) z_anchors = 0, z_bottom / 2, z_bottom, self.z_cup, self.z_mid, self.z_length anchors = x_anchors, np.zeros_like(x_anchors), z_anchors - obj = spin(anchors, [0, 1, 2, 3], 4, 16) - subsurf(obj, 2) + obj = spin(anchors, [0, 1, 2, 3]) butil.modify_mesh(obj, "SOLIDIFY", thickness=self.thickness) - subsurf(obj, 1) obj.scale = [self.scale] * 3 butil.apply_transform(obj) diff --git a/infinigen/assets/utils/draw.py b/infinigen/assets/utils/draw.py index fbfdab1f..dd3a6256 100644 --- a/infinigen/assets/utils/draw.py +++ b/infinigen/assets/utils/draw.py @@ -74,7 +74,7 @@ def surface_from_func(fn, div_x=16, div_y=16, size_x=2, size_y=2): return mesh -def bezier_curve(anchors, vector_locations=(), resolution=64, to_mesh=True): +def bezier_curve(anchors, vector_locations=(), resolution=None, to_mesh=True): n = [len(r) for r in anchors if isinstance(r, Sized)][0] anchors = np.array( [ @@ -98,22 +98,37 @@ def bezier_curve(anchors, vector_locations=(), resolution=64, to_mesh=True): else: points[i].handle_left_type = "AUTO" points[i].handle_right_type = "AUTO" - obj.data.splines[0].resolution_u = resolution - if to_mesh: - return curve2mesh(obj) - return obj + obj.data.splines[0].resolution_u = resolution if resolution is not None else 12 + if not to_mesh: + return obj + return curve2mesh(obj) def curve2mesh(obj): + points = obj.data.splines[0].bezier_points + cos = np.array([p.co for p in points]) + length = np.linalg.norm(cos[:-1] - cos[1:], axis=-1) + min_length = 5e-3 + with butil.ViewportMode(obj, "EDIT"): + for i in reversed(range(len(points) - 1)): + points = list(obj.data.splines[0].bezier_points) + number_cuts = min(int(length[i] / min_length) - 1, 64) + if number_cuts < 0: + continue + bpy.ops.curve.select_all(action="DESELECT") + points[i].select_control_point = True + points[i + 1].select_control_point = True + bpy.ops.curve.subdivide(number_cuts=number_cuts) + obj.data.splines[0].resolution_u = 1 with butil.SelectObjects(obj): bpy.ops.object.convert(target="MESH") obj = bpy.context.active_object - butil.modify_mesh(obj, "WELD", merge_threshold=1e-4) + butil.modify_mesh(obj, "WELD", merge_threshold=1e-3) return obj def align_bezier( - anchors, axes=None, scale=None, vector_locations=(), resolution=64, to_mesh=True + anchors, axes=None, scale=None, vector_locations=(), resolution=None, to_mesh=True ): obj = bezier_curve(anchors, vector_locations, resolution, False) points = obj.data.splines[0].bezier_points @@ -145,9 +160,9 @@ def align_bezier( * np.linalg.norm(p.handle_right - p.co) * scale[2 * i + 1] ) - if to_mesh: - return curve2mesh(obj) - return obj + if not to_mesh: + return obj + return curve2mesh(obj) def remesh_fill(obj, resolution=0.005): @@ -168,22 +183,22 @@ def remesh_fill(obj, resolution=0.005): def spin( anchors, vector_locations=(), - subdivision=64, resolution=None, + rotation_resolution=None, axis=(0, 0, 1), loop=False, dupli=False, ): - obj = bezier_curve(anchors, vector_locations, subdivision) + obj = bezier_curve(anchors, vector_locations, resolution) co = read_co(obj) - max_radius = np.amax( + mean_radius = np.mean( np.linalg.norm( co - (co @ np.array(axis))[:, np.newaxis] * np.array(axis), axis=-1 ) ) - if resolution is None: - resolution = min(int(2 * np.pi * max_radius / 0.005), 128) - butil.modify_mesh(obj, "WELD", merge_threshold=1e-4) + if rotation_resolution is None: + rotation_resolution = min(int(2 * np.pi * mean_radius / 5e-3), 128) + butil.modify_mesh(obj, "WELD", merge_threshold=1e-3) if loop: with butil.ViewportMode(obj, "EDIT"), butil.Suppress(): bpy.ops.mesh.select_all(action="SELECT") @@ -191,9 +206,11 @@ def spin( remesh_fill(obj) with butil.ViewportMode(obj, "EDIT"), butil.Suppress(): bpy.ops.mesh.select_all(action="SELECT") - bpy.ops.mesh.spin(steps=resolution, angle=np.pi * 2, axis=axis, dupli=dupli) + bpy.ops.mesh.spin( + steps=rotation_resolution, angle=np.pi * 2, axis=axis, dupli=dupli + ) bpy.ops.mesh.select_all(action="SELECT") - bpy.ops.mesh.remove_doubles(threshold=1e-4) + bpy.ops.mesh.remove_doubles(threshold=1e-3) return obj From ee056f5f2f21f335016a826bc8508deaf17c947a Mon Sep 17 00:00:00 2001 From: pvl-bot Date: Fri, 18 Oct 2024 13:13:44 -0400 Subject: [PATCH 13/14] Revert "Add action=append for argparse for all configs, overrides, pipeline_overrides etc, to avoid silent failure if specified twice e.g. #336 #303" --- infinigen/datagen/manage_jobs.py | 5 ----- infinigen/tools/download_pregenerated_data.py | 3 --- infinigen/tools/submit_asset_cache.py | 1 - infinigen_examples/generate_individual_assets.py | 5 ++--- infinigen_examples/generate_indoors.py | 5 +---- infinigen_examples/generate_nature.py | 3 --- 6 files changed, 3 insertions(+), 19 deletions(-) diff --git a/infinigen/datagen/manage_jobs.py b/infinigen/datagen/manage_jobs.py index 0e82bfa4..fcfc4e78 100644 --- a/infinigen/datagen/manage_jobs.py +++ b/infinigen/datagen/manage_jobs.py @@ -771,7 +771,6 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N "--specific_seed", default=None, nargs="+", - action="append", help="The default, None, will choose a random seed per scene. Otherwise, all " "scenes will have the specified seed. Interpreted as an integer if possible.", ) @@ -799,7 +798,6 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N parser.add_argument( "--configs", nargs="*", - action="append", default=[], help="List of gin config names to pass through to all underlying " "scene generation jobs.", @@ -808,7 +806,6 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N "-p", "--overrides", nargs="+", - action="append", type=str, default=[], help="List of gin overrides to pass through to all underlying " @@ -825,14 +822,12 @@ def main(args, shuffle=True, wandb_project="render", upload_commandfile_method=N "--pipeline_configs", type=str, nargs="+", - action="append", help="List of gin config names from tools/pipeline_configs " "to configure this execution", ) parser.add_argument( "--pipeline_overrides", nargs="+", - action="append", type=str, default=[], help="List of gin overrides to configure this execution", diff --git a/infinigen/tools/download_pregenerated_data.py b/infinigen/tools/download_pregenerated_data.py index 4b50bd14..69e73826 100644 --- a/infinigen/tools/download_pregenerated_data.py +++ b/infinigen/tools/download_pregenerated_data.py @@ -290,7 +290,6 @@ def main(args): "--seeds", type=str, nargs="+", - action="append", default=None, help="What scenes should we download? Omit to download all available in this release", ) @@ -298,7 +297,6 @@ def main(args): "--cameras", type=str, nargs="+", - action="append", default=None, help="What cameras should we download data for? Omit to download all available in this release", ) @@ -306,7 +304,6 @@ def main(args): "--data_types", type=str, nargs="+", - action="append", default=None, help="What data types (e.g Image, Depth, etc) should we download data for? Omit to download all available in this release", ) diff --git a/infinigen/tools/submit_asset_cache.py b/infinigen/tools/submit_asset_cache.py index 2e5131c8..fb1bb259 100644 --- a/infinigen/tools/submit_asset_cache.py +++ b/infinigen/tools/submit_asset_cache.py @@ -26,7 +26,6 @@ def get_slurm_banned_nodes(config_path=None): "-a", "--assets", nargs="+", - action="append", default=[ "CachedBushFactory", "CachedTreeFactory", diff --git a/infinigen_examples/generate_individual_assets.py b/infinigen_examples/generate_individual_assets.py index a4c85796..d21c7608 100644 --- a/infinigen_examples/generate_individual_assets.py +++ b/infinigen_examples/generate_individual_assets.py @@ -485,7 +485,8 @@ def main(args): if len(factories) == 1 and factories[0].endswith(".txt"): factories = [ - f.split(".")[-1] for f in load_txt_list(factories[0], skip_sharp=False) + f.split(".")[-1] + for f in load_txt_list(factories[0], skip_sharp=False) ] else: assert not any(f.endswith(".txt") for f in factories) @@ -671,7 +672,6 @@ def make_args(): "--configs", type=str, nargs="+", - action="append", default=[], help="List of gin config files to apply", ) @@ -679,7 +679,6 @@ def make_args(): "--overrides", type=str, nargs="+", - action="append", default=[], help="List of gin overrides to apply", ) diff --git a/infinigen_examples/generate_indoors.py b/infinigen_examples/generate_indoors.py index 2b04dd46..129d9a8c 100644 --- a/infinigen_examples/generate_indoors.py +++ b/infinigen_examples/generate_indoors.py @@ -522,7 +522,6 @@ def main(args): "-t", "--task", nargs="+", - action="append", default=["coarse"], choices=[ "coarse", @@ -538,8 +537,7 @@ def main(args): "-g", "--configs", nargs="+", - action="append", - default=[], + default=["base"], help="Set of config files for gin (separated by spaces) " "e.g. --gin_config file1 file2 (exclude .gin from path)", ) @@ -547,7 +545,6 @@ def main(args): "-p", "--overrides", nargs="+", - action="append", default=[], help="Parameter settings that override config defaults " "e.g. --gin_param module_1.a=2 module_2.b=3", diff --git a/infinigen_examples/generate_nature.py b/infinigen_examples/generate_nature.py index 062520b8..8f689dc6 100644 --- a/infinigen_examples/generate_nature.py +++ b/infinigen_examples/generate_nature.py @@ -982,7 +982,6 @@ def main(args): "-t", "--task", nargs="+", - action="append", default=["coarse"], choices=[ "coarse", @@ -998,7 +997,6 @@ def main(args): "-g", "--configs", nargs="+", - action="append", default=["base"], help="Set of config files for gin (separated by spaces) " "e.g. --gin_config file1 file2 (exclude .gin from path)", @@ -1007,7 +1005,6 @@ def main(args): "-p", "--overrides", nargs="+", - action="append", default=[], help="Parameter settings that override config defaults " "e.g. --gin_param module_1.a=2 module_2.b=3", From 3e201d430d6780a159e6f078e71db03a9e1d5e7c Mon Sep 17 00:00:00 2001 From: pvl-bot Date: Fri, 18 Oct 2024 13:31:35 -0400 Subject: [PATCH 14/14] Fix crash on missing populate.err and args.base_path in integration_test compare --- tests/integration/compare.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/compare.py b/tests/integration/compare.py index eca7c474..a2ea0bd4 100644 --- a/tests/integration/compare.py +++ b/tests/integration/compare.py @@ -68,8 +68,8 @@ def parse_scene_log( break else: continue - errFile = open(filepath) - text = errFile.read() + + text = filepath.read_text() if "[MAIN TOTAL] finished in" not in text: continue search = re.search( @@ -335,7 +335,7 @@ def main(): for col in main_df: if col.startswith("img_path"): main_df[col] = main_df[col].apply( - lambda x: "../" + str(x.relative_to(args.base_path)) + lambda x: "../" + str(x.relative_to(runs_folder.parent)) if isinstance(x, Path) else x )