Skip to content

Commit

Permalink
Add action=append for argparse for all configs, overrides, pipeline_o…
Browse files Browse the repository at this point in the history
…verrides etc, to avoid silent failure if specified twice e.g. princeton-vl#336 princeton-vl#303
  • Loading branch information
araistrick authored and pvl-bot committed Oct 8, 2024
1 parent 34c9a93 commit 8bc75f6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions infinigen/datagen/manage_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)
Expand Down Expand Up @@ -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.",
Expand All @@ -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 "
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions infinigen/tools/download_pregenerated_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,20 +290,23 @@ 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",
)
parser.add_argument(
"--cameras",
type=str,
nargs="+",
action="append",
default=None,
help="What cameras should we download data for? Omit to download all available in this release",
)
parser.add_argument(
"--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",
)
Expand Down
1 change: 1 addition & 0 deletions infinigen/tools/submit_asset_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def get_slurm_banned_nodes(config_path=None):
"-a",
"--assets",
nargs="+",
action="append",
default=[
"CachedBushFactory",
"CachedTreeFactory",
Expand Down
5 changes: 3 additions & 2 deletions infinigen_examples/generate_individual_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -671,13 +670,15 @@ def make_args():
"--configs",
type=str,
nargs="+",
action="append",
default=[],
help="List of gin config files to apply",
)
parser.add_argument(
"--overrides",
type=str,
nargs="+",
action="append",
default=[],
help="List of gin overrides to apply",
)
Expand Down
5 changes: 4 additions & 1 deletion infinigen_examples/generate_indoors.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ def main(args):
"-t",
"--task",
nargs="+",
action="append",
default=["coarse"],
choices=[
"coarse",
Expand All @@ -537,14 +538,16 @@ 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)",
)
parser.add_argument(
"-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",
Expand Down
3 changes: 3 additions & 0 deletions infinigen_examples/generate_nature.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ def main(args):
"-t",
"--task",
nargs="+",
action="append",
default=["coarse"],
choices=[
"coarse",
Expand All @@ -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)",
Expand All @@ -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",
Expand Down

0 comments on commit 8bc75f6

Please sign in to comment.