From b0791e5136d7f03dbf3cb762d53eccce0eb9312e Mon Sep 17 00:00:00 2001 From: QuanyiLi Date: Sun, 7 May 2023 16:05:42 +0100 Subject: [PATCH] test scenarios --- scenarionet/examples/run_combine_scenarios.py | 2 +- scenarionet/tests/_test_combine_dataset_local.py | 2 +- scenarionet/tests/script/run_env.py | 2 +- scenarionet/tests/test_combine_dataset.py | 4 +++- scenarionet/verifier/utils.py | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scenarionet/examples/run_combine_scenarios.py b/scenarionet/examples/run_combine_scenarios.py index 75d5039..cfe9076 100644 --- a/scenarionet/examples/run_combine_scenarios.py +++ b/scenarionet/examples/run_combine_scenarios.py @@ -11,7 +11,7 @@ if __name__ == '__main__': dataset_paths = [os.path.join(SCENARIONET_DATASET_PATH, "nuscenes")] dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "nuplan")) dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "waymo")) - dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "nuscenes")) + dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "pg")) combine_path = os.path.join(SCENARIONET_DATASET_PATH, "combined_dataset") combine_multiple_dataset(combine_path, *dataset_paths, force_overwrite=True, try_generate_missing_file=True) diff --git a/scenarionet/tests/_test_combine_dataset_local.py b/scenarionet/tests/_test_combine_dataset_local.py index ed5b879..f41e79e 100644 --- a/scenarionet/tests/_test_combine_dataset_local.py +++ b/scenarionet/tests/_test_combine_dataset_local.py @@ -9,7 +9,7 @@ def _test_combine_dataset(): dataset_paths = [os.path.join(SCENARIONET_DATASET_PATH, "nuscenes")] dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "nuplan")) dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "waymo")) - dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "nuscenes")) + dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "pg")) combine_path = os.path.join(SCENARIONET_DATASET_PATH, "combined_dataset") combine_multiple_dataset(combine_path, *dataset_paths, force_overwrite=True, try_generate_missing_file=True) diff --git a/scenarionet/tests/script/run_env.py b/scenarionet/tests/script/run_env.py index d13390c..090620d 100644 --- a/scenarionet/tests/script/run_env.py +++ b/scenarionet/tests/script/run_env.py @@ -11,7 +11,7 @@ if __name__ == '__main__': dataset_paths = [os.path.join(SCENARIONET_DATASET_PATH, "nuscenes")] dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "nuplan")) dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "waymo")) - dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "nuscenes")) + dataset_paths.append(os.path.join(SCENARIONET_DATASET_PATH, "pg")) combine_path = os.path.join(SCENARIONET_DATASET_PATH, "combined_dataset") combine_multiple_dataset(combine_path, *dataset_paths, force_overwrite=True, try_generate_missing_file=True) diff --git a/scenarionet/tests/test_combine_dataset.py b/scenarionet/tests/test_combine_dataset.py index a9ef874..aef28c5 100644 --- a/scenarionet/tests/test_combine_dataset.py +++ b/scenarionet/tests/test_combine_dataset.py @@ -21,7 +21,9 @@ def test_combine_multiple_dataset(): summary, sorted_scenarios, mapping = read_dataset_summary(dataset_path) for scenario_file in sorted_scenarios: read_scenario(os.path.join(dataset_path, mapping[scenario_file], scenario_file)) - success, result = verify_loading_into_metadrive(dataset_path, result_save_dir="./test_dataset") + success, result = verify_loading_into_metadrive(dataset_path, + result_save_dir="./test_dataset", + steps_to_run=300) assert success diff --git a/scenarionet/verifier/utils.py b/scenarionet/verifier/utils.py index 30e6173..65674fe 100644 --- a/scenarionet/verifier/utils.py +++ b/scenarionet/verifier/utils.py @@ -10,6 +10,7 @@ from metadrive.scenario.utils import get_number_of_scenarios def verify_loading_into_metadrive(dataset_path, result_save_dir=None, steps_to_run=0): + print("================ Begin Scenario Loading oVerification ================ \n") scenario_num = get_number_of_scenarios(dataset_path) if result_save_dir is not None: assert os.path.exists(result_save_dir) and os.path.isdir(