Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] #64 - Add ability to specify map in Dataset-Generator #65

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions code/perception/src/dataset_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,26 +246,33 @@ 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
use_empty_world = args.use_empty_world

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)
Expand Down
19 changes: 11 additions & 8 deletions doc/06_perception/01_dataset_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Korbinian Stein

<!-- TOC -->

* [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)

<!-- TOC -->

Expand Down Expand Up @@ -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
Expand Down
Loading