From 15949f259c4696a9c3d395bb0e0e8919fa2bbd61 Mon Sep 17 00:00:00 2001 From: Easton Potokar Date: Wed, 11 Jun 2025 13:48:02 -0400 Subject: [PATCH 1/2] Automatically set output based on config filename. Fix time estimate length bug --- python/evalio/cli/parser.py | 2 +- python/evalio/cli/run.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/python/evalio/cli/parser.py b/python/evalio/cli/parser.py index c8c2cd6a..3e591349 100644 --- a/python/evalio/cli/parser.py +++ b/python/evalio/cli/parser.py @@ -251,7 +251,7 @@ def parse_config( params = yaml.safe_load(f) # get output directory - out = Path(params["output_dir"]) + out = Path(params["output_dir"]) if "output_dir" in params else None # process datasets & make sure they are downloaded by building datasets = DatasetBuilder.parse(params.get("datasets", None)) diff --git a/python/evalio/cli/run.py b/python/evalio/cli/run.py index 14ca501f..607960c2 100644 --- a/python/evalio/cli/run.py +++ b/python/evalio/cli/run.py @@ -2,6 +2,7 @@ from evalio.cli.completions import DatasetOpt, PipelineOpt from evalio.utils import print_warning from tqdm.rich import tqdm +import numpy as np from evalio.types import ImuMeasurement, LidarMeasurement from evalio.rerun import RerunVis, VisArgs @@ -77,17 +78,18 @@ def run_from_cli( "Cannot specify both config and manual options", param_hint="run" ) + # Got through visualization options if show is None: vis_args = VisArgs(show=visualize) else: vis_args = show vis = RerunVis(vis_args) + # Parse the config file if provided if config is not None: pipelines, datasets, out = parse_config(config) if out is None: - print_warning("Output directory not set. Defaulting to './evalio_results'") - out = Path("./evalio_results") + out = Path("./evalio_results") / config.stem else: if in_pipelines is None: @@ -134,7 +136,10 @@ def run( print( f"Running {plural(len(pipelines), 'pipeline')} on {plural(len(datasets), 'dataset')} => {plural(len(pipelines) * len(datasets), 'experiment')}" ) - lengths = [d.length if d.length is not None else len(d.build()) for d in datasets] + lengths = [ + min(d.length if d.length is not None else np.inf, len(d.build())) + for d in datasets + ] dtime = sum(le / d.dataset.lidar_params().rate for le, d in zip(lengths, datasets)) # type: ignore dtime *= len(pipelines) if dtime > 3600: From 272dc520c5b57981832730bf530885d6844f9f0b Mon Sep 17 00:00:00 2001 From: Easton Potokar Date: Wed, 11 Jun 2025 13:49:11 -0400 Subject: [PATCH 2/2] typo --- python/evalio/cli/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/evalio/cli/run.py b/python/evalio/cli/run.py index 607960c2..64647a79 100644 --- a/python/evalio/cli/run.py +++ b/python/evalio/cli/run.py @@ -78,7 +78,7 @@ def run_from_cli( "Cannot specify both config and manual options", param_hint="run" ) - # Got through visualization options + # Go through visualization options if show is None: vis_args = VisArgs(show=visualize) else: