Skip to content

Commit 7695b27

Browse files
committed
Add viser to CLI and refactorings.
1 parent 8480cdf commit 7695b27

File tree

15 files changed

+142
-182
lines changed

15 files changed

+142
-182
lines changed
File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import logging
2+
3+
from hydra.utils import instantiate
4+
from omegaconf import DictConfig
5+
6+
from py123d.script.builders.utils.utils_type import validate_type
7+
from py123d.visualization.viser.viser_config import ViserConfig
8+
9+
logger = logging.getLogger(__name__)
10+
11+
12+
def build_viser_config(cfg: DictConfig) -> ViserConfig:
13+
"""
14+
Builds the config dataclass for the viser viewer.
15+
:param cfg: DictConfig. Configuration that is used to run the viewer.
16+
:return: Instance of ViserConfig.
17+
"""
18+
logger.info("Building ViserConfig...")
19+
viser_config: ViserConfig = instantiate(cfg)
20+
validate_type(viser_config, ViserConfig)
21+
logger.info("Building ViserConfig...DONE!")
22+
return viser_config

src/py123d/script/config/common/default_common.yaml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@ defaults:
33
- worker: ray_distributed
44
- scene_filter: all_scenes
55
- scene_builder: default_scene_builder
6-
- override hydra/job_logging: colorlog
6+
- override hydra/job_logging: disabled
77
- override hydra/hydra_logging: colorlog
88
- _self_
9-
10-
distributed_timeout_seconds: 7200 # Sets how long to wait while synchronizing across worker nodes in a distributed context.
11-
selected_simulation_metrics: null
12-
13-
# Sets verbosity level, in particular determines if progress bars are shown or not.
14-
verbose: false
15-
16-
# Logger
17-
logger_level: info # Level of logger
18-
logger_format_string: null # Logger format string, set null to use the default format string
19-
20-
# Execution
21-
max_number_of_workers: null # Set null to disable threading for simulation execution
22-
gpu: true # Whether to use available GPUs during training/simulation
23-
24-
25-
seed: 42

src/py123d/script/config/common/default_experiment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
defaults:
2+
- _self_
23
- default_dataset_paths
34
- override hydra/job_logging: colorlog
45
- override hydra/hydra_logging: colorlog
5-
- _self_
66

77
# Cache parameters
88
experiment_name: ???

src/py123d/script/config/common/scene_filter/all_scenes.yaml renamed to src/py123d/script/config/common/scene_filter/nuplan_logs.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@ _target_: py123d.datatypes.scene.scene_filter.SceneFilter
22
_convert_: 'all'
33

44
split_types: null
5-
split_names: null
5+
split_names:
6+
- "nuplan_train"
7+
- "nuplan_val"
8+
- "nuplan_test"
69
log_names: null
710

811

912
locations: null
1013
scene_uuids: null
1114
timestamp_threshold_s: null
1215
ego_displacement_minimum_m: null
13-
14-
duration_s: 9.2
15-
history_s: 3.0
16-
17-
camera_types: null
18-
1916
max_num_scenes: null
20-
shuffle: false
17+
18+
duration_s: null
19+
history_s: null

src/py123d/script/config/common/scene_filter/nuplan_mini_train.yaml renamed to src/py123d/script/config/common/scene_filter/nuplan_mini_logs.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ _convert_: 'all'
44
split_types: null
55
split_names:
66
- "nuplan_mini_train"
7+
- "nuplan_mini_val"
8+
- "nuplan_mini_test"
79
log_names: null
810

911

1012
locations: null
1113
scene_uuids: null
12-
timestamp_threshold_s: 1.0
14+
timestamp_threshold_s: null
1315
ego_displacement_minimum_m: null
1416
max_num_scenes: null
1517

16-
duration_s: 8.1
17-
history_s: 1.0
18+
duration_s: null
19+
history_s: null

src/py123d/script/config/common/scene_filter/nuplan_mini_val.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/py123d/script/config/common/scene_filter/nuplan_sim_agent.yaml

Lines changed: 0 additions & 117 deletions
This file was deleted.

src/py123d/script/config/common/scene_filter/viser_scenes.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ log_names: null
88

99
locations: null
1010
scene_uuids: null
11-
timestamp_threshold_s: 10.0
11+
timestamp_threshold_s: null
1212
ego_displacement_minimum_m: null
1313

14-
duration_s: 10.0
15-
history_s: 0.0
14+
duration_s: null
15+
history_s: null
1616

17-
camera_types: null
17+
pinhole_camera_types: null
1818

1919
max_num_scenes: null
2020
shuffle: True

src/py123d/script/config/conversion/default_conversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
hydra:
2+
output_subdir: null
23
run:
34
dir: .
4-
output_subdir: null
55
searchpath:
66
- pkg://py123d.script.config
77
- pkg://py123d.script.config.common

0 commit comments

Comments
 (0)