simpl_prediction / README.md
xmfcx's picture
feat: add simpl_prediction v0.1 artifacts (from awf.ml.dev.web.auto/perception/models/simpl/v0.1.0)
e6218be verified
|
Raw
History Blame Contribute Delete
6.18 kB
---
license: apache-2.0
pipeline_tag: robotics
tags:
- autoware
- ros2
- autonomous-driving
- motion-prediction
- trajectory-prediction
- simpl
- tensorrt
- onnx
---
# SIMPL for Autoware (`simpl_prediction`)
Multi-agent motion prediction model for autonomous driving, used by the
[`autoware_simpl_prediction`](https://github.com/autowarefoundation/autoware_universe/tree/main/perception/autoware_simpl_prediction)
node in [Autoware](https://github.com/autowarefoundation/autoware).
The model follows the **SIMPL** [1] architecture (A Simple and Efficient Multi-agent Motion Prediction
Baseline for Autonomous Driving) and runs with TensorRT inside Autoware. It is exported as ONNX so it can be
deployed across hardware; Autoware builds the TensorRT engine from the ONNX file on first launch.
## Model overview
| | |
| --- | --- |
| Task | Multi-modal trajectory prediction for tracked traffic agents |
| Architecture | SIMPL [1] |
| Predicted agent classes | `VEHICLE`, `PEDESTRIAN`, `MOTORCYCLIST`, `CYCLIST`, `LARGE_VEHICLE` |
| Runtime | TensorRT (FP32 by default) via the `autoware_simpl_prediction` ROS 2 node |
| Format | ONNX (Autoware builds the TensorRT engine locally on first launch) |
| License | Apache-2.0 |
Autoware object labels are mapped to the model's agent classes as follows: `CAR` to `VEHICLE`, `PEDESTRIAN`
to `PEDESTRIAN`, `BICYCLE` to `CYCLIST`, `MOTORCYCLE` to `MOTORCYCLIST`, and `TRUCK` / `TRAILER` / `BUS` to
`LARGE_VEHICLE`. Only agents whose mapped label is listed in the node's `preprocess.labels` parameter are
predicted and published.
The following dimensions are fixed at ONNX export time (dynamic shape inference is not supported yet), and
the default node configuration matches them:
| Parameter | Symbol | Value |
| --- | --- | --- |
| Maximum number of agents | N | 50 |
| Past history length | T_past | 8 |
| Maximum number of map polylines | K | 300 |
| Maximum points per polyline | P | 10 |
| Number of prediction modes | M | 6 |
| Future horizon length | T_future | 80 |
## Files
| File | Description |
| --- | --- |
| `simpl.onnx` | SIMPL motion prediction network (ONNX) |
| `deploy_metadata.yaml` | Deployment metadata recording the artifact version of this repository |
> **TensorRT engines are not distributed here.** TensorRT engines are specific to the GPU architecture and
> TensorRT version they are built on and are not portable, so Autoware builds them locally from the ONNX file
> on first launch (or via `build_only:=true`).
## Inputs and outputs
**Network inputs**
- Agent histories: `N x D_agent x T_past` (past states of the tracked agents)
- Map points: `K x P x D_map` (lanelet map polylines)
- Relative pose encoding: `(N + K) x (N + K) x D_rpe`
**Network outputs**
- Predicted scores: `N x M` (confidence per agent and mode)
- Predicted trajectories: `N x M x T_future x D_trajectory`, where `D_trajectory` is `(x, y, vx, vy)` in the
agent local coordinate frame
**Node topics (as used by `autoware_simpl_prediction`)**
| Topic | Type | Direction |
| --- | --- | --- |
| `~/input/objects` | `autoware_perception_msgs/msg/TrackedObjects` | input |
| `~/input/vector_map` | `autoware_map_msgs/msg/LaneletMapBin` | input |
| `/localization/kinematic_state` | `nav_msgs/msg/Odometry` | input |
| `~/output/objects` | `autoware_perception_msgs/msg/PredictedObjects` | output |
Pre-processing (agent history accumulation, lanelet-to-polyline conversion) and post-processing (mode score
thresholding) run in the node, not in the ONNX graph.
## Usage in Autoware
The node expects the artifacts under `~/autoware_data/ml_models/simpl_prediction/` and launches with:
```bash
ros2 launch autoware_simpl_prediction simpl.launch.xml
```
Add `build_only:=true` to build the TensorRT engine from the ONNX as a one-off pre-task. The default
parameters (`config/simpl.param.yaml`) point to `simpl.onnx` in the data directory and use `fp32` precision.
See the [package README](https://github.com/autowarefoundation/autoware_universe/tree/main/perception/autoware_simpl_prediction)
for the full parameter reference.
## Training
The SIMPL architecture and reference training code originate from the upstream project:
- Original implementation: <https://github.com/HKUST-Aerial-Robotics/SIMPL>
- Paper: "SIMPL: A Simple and Efficient Multi-agent Motion Prediction Baseline for Autonomous Driving",
arXiv:2402.02519
An Autoware library to train and deploy SIMPL and other motion prediction models is work in progress, as
noted in the package README. The training data and training configuration used to produce the released
`simpl.onnx` weights are not publicly documented.
## Limitations
- The number of predictable agents is fixed at export time (`max_num_agent: 50`); dynamic shape inference is
not supported yet.
- Only agents whose label is contained in `preprocess.labels` are published; other road users are ignored.
- Predicted modes with a confidence score below `postprocess.score_threshold` are filtered out. If all modes
of an object are filtered, the published object contains no path, and the remaining mode confidences are
not guaranteed to sum to 100%.
- Agent history that is no longer observed in incoming callbacks is dropped, which resets prediction context
for reappearing agents.
## Provenance
| | |
| --- | --- |
| Original artifact source | `https://awf.ml.dev.web.auto/perception/models/simpl/v0.1.0/simpl.onnx` |
| Source version string | `simpl/v0.1.0` |
| Tag in this repository | `v0.1` (normalized from `v0.1.0`) |
| `simpl.onnx` SHA-256 | `ad5e03983193c4d188432f314334697d6a216e7ffc91fb651eee5d6e4c42f492` |
## Citation
```bibtex
@article{zhang2024simpl,
title = {SIMPL: A Simple and Efficient Multi-agent Motion Prediction Baseline for Autonomous Driving},
author = {Zhang, Lu and Li, Peiliang and Liu, Sikang and Shen, Shaojie},
journal = {arXiv preprint arXiv:2402.02519},
year = {2024}
}
```
## References
- [1] Zhang et al., "SIMPL: A Simple and Efficient Multi-agent Motion Prediction Baseline for Autonomous Driving", arXiv:2402.02519, 2024.
- [2] Original implementation: <https://github.com/HKUST-Aerial-Robotics/SIMPL>