From b8341e2686f5769aa8a389b82d557e7ea3cc17e0 Mon Sep 17 00:00:00 2001 From: MaxJa4 Date: Thu, 16 Nov 2023 19:32:24 +0100 Subject: [PATCH 1/2] feat(#64): Add ability to specify map --- code/perception/src/dataset_generator.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/code/perception/src/dataset_generator.py b/code/perception/src/dataset_generator.py index 58f5d4b4..fd849d11 100644 --- a/code/perception/src/dataset_generator.py +++ b/code/perception/src/dataset_generator.py @@ -246,15 +246,21 @@ def create_argparse(): help='set up an empty world and spawn ego vehicle', default=False ) + argparser.add_argument( + '--town', + metavar='T', + default='Town12', + help='town to load' + ) return argparser if __name__ == '__main__': - towns = ["Town01", "Town02", "Town03", "Town04", "Town05", "Town06", - "Town07", "Town10", "Town11", "Town12"] - town = towns[2] + towns = {"Town01", "Town02", "Town03", "Town04", "Town05", "Town06", + "Town07", "Town10", "Town11", "Town12"} argparser = create_argparse() args = argparser.parse_args() + town = args.town output_dir = args.output_dir host = args.host port = args.port @@ -262,10 +268,11 @@ def create_argparse(): client = carla.Client(host, port) client.set_timeout(30) - world = client.load_world(town) + world = client.load_world(town) if use_empty_world else client.get_world() world.wait_for_tick() - output_dir = os.path.join(output_dir, town[-2:]) + output_dir = os.path.join(output_dir, world.get_map().name[-2:]) + print("Saving images to {}".format(output_dir)) if use_empty_world: ego_vehicle = setup_empty_world(client) From 644f8641f3477426403fb0a434573dbc6c2814d4 Mon Sep 17 00:00:00 2001 From: MaxJa4 Date: Thu, 16 Nov 2023 19:38:36 +0100 Subject: [PATCH 2/2] docs: Add argument description for --town --- doc/06_perception/01_dataset_generator.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/06_perception/01_dataset_generator.md b/doc/06_perception/01_dataset_generator.md index 0c33e97e..ad688f7d 100644 --- a/doc/06_perception/01_dataset_generator.md +++ b/doc/06_perception/01_dataset_generator.md @@ -15,14 +15,14 @@ Korbinian Stein -* [Dataset generator](#dataset-generator) - * [Author](#author) - * [Date](#date) - * [Necessary adjustments](#necessary-adjustments) - * [Dockerfile](#dockerfile) - * [docker-compose.yml](#docker-composeyml) - * [Usage](#usage) - * [Using with leaderboard](#using-with-leaderboard) +- [Dataset generator](#dataset-generator) + - [Author](#author) + - [Date](#date) + - [Necessary adjustments](#necessary-adjustments) + - [Dockerfile](#dockerfile) + - [docker-compose.yml](#docker-composeyml) + - [Usage](#usage) + - [Using with leaderboard](#using-with-leaderboard) @@ -103,6 +103,9 @@ camera images in four directions: `[center, left, right, back]`. We then store these images in the output directory can be specified with the `--output-dir` flag. +Specify the desired map via `--town` and use `TownXX` with XX being 01, 02, ..., 07, 10, 11, 12. +Default value is `Town12` like used in leaderboard 2.0. + ### Using with leaderboard To use the dataset generator with the leaderboard, first start the leaderboard evaluation by adjusting the command in