Skip to content

Commit 9f3ea68

Browse files
DanielDaunermh0797
authored andcommitted
devkit-v1.0
1 parent 800cbd1 commit 9f3ea68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+121004
-211
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
# files
1414
*.log
1515
*.pkl
16+
*.jpg
17+
*.pcd

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@
2525
> - Large-scale publicly available test split for internal benchmarking
2626
> - Continually-maintained devkit
2727
28-
🏁 **NAVSIM** will serve as a main track in the **`CVPR 2024 Autonomous Grand Challenge`**. The warm-up phase of the challenge has begun! For further details, please [check the challenge website](https://opendrivelab.com/challenge2024/)!
28+
🏁 **NAVSIM** will serve as a main track in the **`CVPR 2024 Autonomous Grand Challenge`**. The leaderboard for the challenge is open! For further details, please [check the challenge website](https://opendrivelab.com/challenge2024/)!
2929

30+
<p align="center">
31+
<img src="assets/navsim_cameras.gif" width="800">
32+
</p>
3033

3134
## Table of Contents
3235
1. [Highlights](#highlight)
@@ -41,15 +44,21 @@
4144
- [Download and installation](docs/install.md)
4245
- [Understanding and creating agents](docs/agents.md)
4346
- [Understanding the data format and classes](docs/cache.md)
47+
- [Dataset splits vs. filtered training / test splits](docs/splits.md)
4448
- [Understanding the PDM Score](docs/metrics.md)
4549
- [Submitting to the Leaderboard](docs/submission.md)
4650

4751
<p align="right">(<a href="#top">back to top</a>)</p>
4852

4953

5054
## Changelog <a name="changelog"></a>
51-
- **`[2024/04/05]`** **IMPORTANT NOTE**: Please re-download the `competition_test` split.
52-
- There has been an issue with the `competition_test` split, so that the Ego-Status information was incorrect. Please download the updated files. For details see [installation](docs/install.md).
55+
- **`[2024/04/21]`** NAVSIM v1.0 release (official devkit version for [AGC 2024](https://opendrivelab.com/challenge2024/))
56+
- **IMPORTANT NOTE**: The name of the data split `competition_test` was changed to `private_test_e2e`. Please adapt your directory name accordingly. For details see [installation](docs/install.md).
57+
- Parallelization of metric caching / evaluation
58+
- Adds [Transfuser](https://arxiv.org/abs/2205.15997) baseline (see [agents](docs/agents.md#Baselines))
59+
- Adds standardized training and test filtered splits (see [splits](docs/splits.md))
60+
- Visualization tools (see [tutorial_visualization.ipynb](tutorial/tutorial_visualization.ipynb))
61+
- Refactoring
5362
- **`[2024/04/03]`** NAVSIM v0.4 release
5463
- Support for test phase frames of competition
5564
- Download script for trainval
@@ -61,7 +70,7 @@
6170
- Major refactoring of dataloading and configs
6271
- **`[2024/03/11]`** NAVSIM v0.2 release
6372
- Easier installation and download
64-
- mini and test split integration
73+
- mini and test data split integration
6574
- Privileged `Human` agent
6675
- **`[2024/02/20]`** NAVSIM v0.1 release (initial demo)
6776
- OpenScene-mini sensor blobs and annotation logs

assets/navsim_cameras.gif

3.42 MB
Loading

docs/agents.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,33 @@ In addition to the methods mentioned above, you have to implement the methods be
3939
Have a look at `navsim.agents.ego_status_mlp_agent.EgoStatusMLPAgent` for an example.
4040

4141
- `get_feature_builders()`
42-
Has to return a List of feature builders (of type `navsim.planning.training. abstract_feature_target_builder.AbstractFeatureBuilder`).
42+
Has to return a List of feature builders (of type `navsim.planning.training.abstract_feature_target_builder.AbstractFeatureBuilder`).
4343
FeatureBuilders take the `AgentInput` object and compute the feature tensors used for agent training and inference. One feature builder can compute multiple feature tensors. They have to be returned in a dictionary, which is then provided to the model in the forward pass.
4444
Currently, we provide the following feature builders:
45-
- EgoStateFeatureBuilder (returns a Tensor containing current velocity, acceleration and driving command)
46-
- _the list will be increased in future devkit versions_
45+
- [EgoStatusFeatureBuilder](https://github.com/autonomousvision/navsim/blob/main/navsim/agents/ego_status_mlp_agent.py#L18) (returns a Tensor containing current velocity, acceleration and driving command)
46+
- [TransfuserFeatureBuilder](https://github.com/autonomousvision/navsim/blob/main/navsim/agents/transfuser/transfuser_features.py#L28) (returns a dictionary containing the current front image, LiDAR BEV map, and the ego status)
4747

4848
- `get_target_builders()`
49-
Similar to `get_feature_builders()`, returns the target builders of type `navsim.planning.training. abstract_feature_target_builder.AbstractTargetBuilder` used in training. In contrast to feature builders, they have access to the Scene object which contains ground-truth information (instead of just the AgentInput).
49+
Similar to `get_feature_builders()`, returns the target builders of type `navsim.planning.training.abstract_feature_target_builder.AbstractTargetBuilder` used in training. In contrast to feature builders, they have access to the Scene object which contains ground-truth information (instead of just the AgentInput).
5050

5151
- `forward()`
5252
The forward pass through the model. Features are provided as a dictionary which contains all the features generated by the feature builders. All tensors are already batched and on the same device as the model. The forward pass has to output a Dict of which one entry has to be "trajectory" and contain a tensor representing the future trajectory, i.e. of shape [B, T, 3], where B is the batch size, T is the number of future timesteps and 3 refers to x,y,heading.
5353

54-
- `compute_loss`()`
54+
- `compute_loss()`
5555
Given the features, the targets and the model predictions, this function computes the loss used for training. The loss has to be returned as a single Tensor.
5656

5757
- `get_optimizers()`
5858
Use this function to define the optimizers used for training.
5959
Depending on whether you want to use a learning-rate scheduler or not, this function needs to either return just an Optimizer (of type `torch.optim.Optimizer`) or a dictionary that contains the Optimizer (key: "optimizer") and the learning-rate scheduler of type `torch.optim.lr_scheduler.LRScheduler` (key: "lr_scheduler").
6060

61+
- `get_training_callbacks()`
62+
In this function, you can return a List of `pl.Callback` to monitor or visualize the training process of the learned model. We implemented a callback for TransFuser in `navsim.agents.transfuser.transfuser_callback.TransfuserCallback`, which can serve as a starting point.
63+
6164
- `compute_trajectory()`
6265
In contrast to the non-learning-based Agent, you don't have to implement this function.
6366
In inference, the trajectory will automatically be computed using the feature builders and the forward method.
67+
68+
6469
## Inputs
6570

6671
`get_sensor_config()` can be overwritten to determine which sensors are accessible to the agent.
@@ -77,5 +82,28 @@ You can configure the set of sensor modalities to use and how much history you n
7782

7883
Given this input, you will need to override the `compute_trajectory()` method and output a `Trajectory`. This is an array of BEV poses (with x, y and heading in local coordinates), as well as a `TrajectorySampling` config object that indicates the duration and frequency of the trajectory. The PDM score is evaluated for a horizon of 4 seconds at a frequency of 10Hz. The `TrajectorySampling` config facilitates interpolation when the output frequency is different from the one used during evaluation.
7984

80-
Check out this simple constant velocity agent for an example agent implementation:
81-
https://github.com/autonomousvision/navsim/blob/51cecd51aa70b0e6bcfb3541b91ae88f2a78a25e/navsim/agents/constant_velocity_agent.py#L9
85+
Check out the baseline for implementations of agents!
86+
87+
88+
## Baselines
89+
90+
NAVSIM provides several baselines, which serve as comparison or starting points for new end-to-end driving models.
91+
92+
### `ConstantVelocityAgent`:
93+
The `ConstantVelocityAgent` is a naive baseline and follows the most simple driving logic. The agent maintains constant speed and a constant heading angle, resulting in a straight-line output trajectory. You can use the agent to familiarize yourself with the `AbstractAgent` interface or analyze samples that have a trivial solution for achieving a high PDM score.
94+
95+
Link to the [implementation](https://github.com/autonomousvision/navsim/blob/main/navsim/agents/constant_velocity_agent.py).
96+
97+
### `EgoStatusMLPAgent`:
98+
The `EgoStatusMLPAgent` is a blind baseline, which ignores all sensors that perceive the environment. The agent applies a Multilayer perceptron to the state of the ego vehicle (i.e., the velocity, acceleration, and driving command). Thereby, the EgoStatusMLP serves as an upper bound for performance, which can be achieved by merely extrapolating the kinematic state of the ego vehicle. The EgoStatusMLP is a lightweight learned example, showcasing the procedure of creating feature caches and training an agent in NAVSIM.
99+
100+
Link to the [implementation](https://github.com/autonomousvision/navsim/blob/main/navsim/agents/ego_status_mlp_agent.py).
101+
102+
### `TransfuserAgent`:
103+
[Transfuser](https://arxiv.org/abs/2205.15997) is an example of a sensor agent that utilizes both camera and LiDAR inputs. The backbone of Transfuser applies CNNs on a front-view camera image and a discretized LiDAR BEV grid. The features from the camera and LiDAR branches are fused over several convolution stages with Transformers to a combined feature representation. The Transfuser architecture combines several auxiliary tasks and imitation learning with strong closed-loop performance in end-to-end driving with the CARLA simulator.
104+
105+
In NAVSIM, we implement the Transfuser backbone from [CARLA Garage](https://github.com/autonomousvision/carla_garage) and use BEV semantic segmentation and DETR-style bounding-box detection as auxiliary tasks. To facilitate the wide-angle camera view of the Transfuser, we stitch patches of the three front-facing cameras. Transfuser is a good starting point for sensor agents and provides pre-processing for image and LiDAR sensors, training visualizations with callbacks, and more advanced loss functions (i.e., Hungarian matching for detection).
106+
107+
Link to the [implementation](https://github.com/autonomousvision/navsim/blob/main/navsim/agents/transfuser).
108+
109+

docs/cache.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
OpenScene is a compact redistribution of the large-scale [nuPlan dataset](https://motional-nuplan.s3.ap-northeast-1.amazonaws.com/index.html), retaining only relevant annotations and sensor data at 2Hz. This reduces the dataset size by a factor of >10. The data used in NAVSIM is structured into `navsim.common.dataclasses.Scene` objects. A `Scene` is a list of `Frame` objects, each containing the required inputs and annotations for training a planning `Agent`.
44

5-
**Filtering.** The NAVSIM validation an test sets will be filtered to increase the representation of challenging situations. Furthermore, the test set will only include agent inputs and exclude any privileged annotations.
6-
75
**Caching.** Evaluating planners involves significant preprocessing of the raw annotation data, including accessing the global map at each ´Frame´ and converting it into a local coordinate system. You can generate the cache with:
86
```
97
cd $NAVSIM_DEVKIT_ROOT/scripts/

docs/install.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ Navigate to the download directory and download the maps
1919
cd download && ./download_maps
2020
```
2121

22-
Next download the splits you want to use.
23-
You can download the mini, trainval, test and submission_test split with the following scripts
22+
Next download the data splits you want to use.
23+
Note that the dataset splits do not exactly map to the recommended standardized training / test splits-
24+
Please refer to [splits](splits.md) for an overview on the standardized training and test splits including their size and check which dataset splits you need to download in order to be able to run them.
25+
26+
You can download the mini, trainval, test and private_test_e2e dataset split with the following scripts
2427
```
2528
./download_mini
2629
./download_trainval
2730
./download_test
28-
./download_competition_test
31+
./download_private_test_e2e
2932
```
30-
31-
**The mini split and the test split take around ~160GB and ~220GB of memory respectively**
33+
Also, the script `./download_navtrain` can be used to download a small portion of the `trainval` dataset split which is needed for the `navtrain` training split.
3234

3335
This will download the splits into the download directory. From there, move it to create the following structure.
3436
```angular2html
@@ -40,17 +42,18 @@ This will download the splits into the download directory. From there, move it t
4042
   ├── navsim_logs
4143
| ├── test
4244
| ├── trainval
43-
| ├── competition_test
45+
| ├── private_test_e2e
4446
   │ └── mini
4547
   └── sensor_blobs
4648
├── test
4749
├── trainval
48-
├── competition_test
50+
├── private_test_e2e
4951
   └── mini
5052
```
5153
Set the required environment variables, by adding the following to your `~/.bashrc` file
5254
Based on the structure above, the environment variables need to be defined as:
5355
```
56+
export NUPLAN_MAP_VERSION="nuplan-maps-v1.0"
5457
export NUPLAN_MAPS_ROOT="$HOME/navsim_workspace/dataset/maps"
5558
export NAVSIM_EXP_ROOT="$HOME/navsim_workspace/exp"
5659
export NAVSIM_DEVKIT_ROOT="$HOME/navsim_workspace/navsim"

docs/splits.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Dataset splits vs. filtered training / test splits
2+
3+
The NAVSIM framework utilizes several dataset splits for standardized training and evaluating agents.
4+
All of them use the OpenScene dataset that is divided into the dataset splits `mini`,`trainval`,`test`,`private_test_e2e`, which can all be downloaded separately.
5+
6+
It is possible to run trainings and evaluations directly on these sets (see `Standard` in table below).
7+
Alternatively, you can run trainings and evaluations on training and validation splits that were filtered for challenging scenarios (see `NAVSIM` in table below), which is the recommended option for producing comparable and competitive results efficiently.
8+
In contrast to the dataset splits which refer to a downloadable set of logs, the training / test splits are implemented as scene filters, which define how scenes are extracted from these logs.
9+
10+
The NAVSIM training / test splits subsample the OpenScene dataset splits.
11+
Moreover, the NAVSIM splits include overlapping scenes, while the Standard splits are non-overlapping.
12+
Specifically, `navtrain` is based on the `trainval` data and `navtest` on the `test` data.
13+
14+
As the `trainval` sensor data is very large, we provide a separate download link, which loads only the frames needed for `navtrain`.
15+
This eases access for users that only want to run the `navtrain` split and not the `trainval` split. If you already downloaded the full `trainval` sensor data, it is **not necessary** to download the `navtrain` frames as well.
16+
The logs are always the complete dataset split.
17+
18+
## Overview
19+
The Table belows offers an overview on the training and test splits supported by NAVSIM. It also shows which config parameters have to be used to set the dataset split (`split`) and training/test split (`scene-filter`).
20+
21+
<table border="0">
22+
<tr>
23+
<th></th>
24+
<th>Name</th>
25+
<th>Description</th>
26+
<th>Logs</th>
27+
<th>Sensors</th>
28+
<th>Config parameters</th>
29+
</tr>
30+
<tr>
31+
<td rowspan="3">Standard</td>
32+
<td>trainval</td>
33+
<td>Large split for training and validating agents with regular driving recordings. Corresponds to nuPlan and downsampled to 2HZ.</td>
34+
<td>14GB</td>
35+
<td>&gt;2000GB</td>
36+
<td>
37+
split=trainval<br>
38+
scene_filter=all_scenes
39+
</td>
40+
</tr>
41+
<tr>
42+
<td>test</td>
43+
<td>Small split for testing agents with regular driving recordings. Corresponds to nuPlan and downsampled to 2HZ.</td>
44+
<td>1GB</td>
45+
<td>217GB</td>
46+
<td>
47+
split=test<br>
48+
scene_filter=all_scenes
49+
</td>
50+
</tr>
51+
<tr>
52+
<td>mini</td>
53+
<td>Demo split for with regular driving recordings. Corresponds to nuPlan and downsampled to 2HZ.</td>
54+
<td>1GB</td>
55+
<td>151GB</td>
56+
<td>
57+
split=mini<br>
58+
scene_filter=all_scenes
59+
</td>
60+
</tr>
61+
<tr>
62+
<td rowspan="2">NAVSIM</td>
63+
<td>navtrain</td>
64+
<td>Standard split for training agents in NAVSIM with non-trivial driving scenes. Sensors available separately in <a href="https://github.com/autonomousvision/navsim/blob/main/download/download_navtrain.sh">download_navtrain.sh</a>.</td>
65+
<td>-</td>
66+
<td>445GB*</td>
67+
<td>
68+
split=trainval<br>
69+
scene_filter=navtrain
70+
</td>
71+
</tr>
72+
<tr>
73+
<td>navtest</td>
74+
<td>Standard split for testing agents in NAVSIM with non-trivial driving scenes. Available as a filter for test split.</td>
75+
<td>-</td>
76+
<td>-</td>
77+
<td>
78+
split=test<br>
79+
scene_filter=navtest
80+
</td>
81+
</tr>
82+
<tr>
83+
<td rowspan="2">Competition</td>
84+
<td>warmup_test_e2e</td>
85+
<td>Warmup test split to validate submission on hugging face. Available as a filter for mini split.</td>
86+
<td>-</td>
87+
<td>-</td>
88+
<td>
89+
split=mini<br>
90+
scene_filter=warmup_test_e2e
91+
</td>
92+
</tr>
93+
<tr>
94+
<td>private_test_e2e</td>
95+
<td>Private test split for the challenge leaderboard on hugging face.</td>
96+
<td>&lt;1GB</td>
97+
<td>25GB</td>
98+
<td>
99+
split=private_test_e2e<br>
100+
scene_filter=private_test_e2e
101+
</td>
102+
</tr>
103+
</table>
104+
105+
(*300GB without history)
106+
107+
## Splits
108+
109+
The standard splits `trainval`, `test`, and `mini` are from the OpenScene dataset. Note that the data corresponds to the nuPlan dataset with a lower frequency of 2Hz. You can download all standard splits over Hugging Face with the bash scripts in [download](../download)
110+
111+
NAVSIM provides a subset and filter of the `trainval` split, called `navtrain`. The `navtrain` split facilitates a standardized training scheme and requires significantly less sensor data storage than `travel` (445GB vs. 2100GB). If your agents don't need historical sensor inputs, you can download `navtrain` without history, which requires 300GB of storage. Note that `navtrain` can be downloaded separately via [download_navtrain.sh](https://github.com/autonomousvision/navsim/blob/main/download/download_navtrain.sh) but still requires access to the `trainval` logs. Similarly, the `navtest` split enables a standardized set for testing agents with a provided scene filter. Both `navtrain` and `navtest` are filtered to increase interesting samples in the sets.
112+
113+
For the challenge on Hugging Face, we provide the `warmup_test_e2e` and `private_test_e2e` for the warm-up and challenge track, respectively. Note that `private_test_e2e` requires you to download the data, while `warmup_test_e2e` is a scene filter for the `mini` split.

0 commit comments

Comments
 (0)