This repository contains the official PyTorch implementation of our NeurIPS 2024 paper: "Learning Cooperative Trajectory Representations for Motion Forecasting".
# Clone the repository
git clone https://github.com/AIR-THU/V2X-Graph
cd V2X-Graph
# Create and activate conda environment
conda create -n v2x_graph python=3.8
conda activate v2x_graph
# Install dependencies
pip install -r requirements.txt
# Clone and install DAIR-V2X-Seq API:
git clone https://github.com/AIR-THU/DAIR-V2X-Seq
export PYTHONPATH="${PYTHONPATH}:/path/to/DAIR-V2X-Seq/projects/dataset"
# Install Argoverse 1 API:
pip install git+https://github.com/argoverse/argoverse-api.git
# For V2X-Seq-TFD
python generate_label.py \
--data_root /path/to/V2X-Seq-TFD/cooperative-vehicle-infrastructure \
--dataset V2X-Seq-TFD
# For V2X-Traj
python generate_label.py \
--data_root /path/to/v2x-traj \
--dataset V2X-Traj
# For V2X-Seq-TFD
python preprocess.py \
--root /path/to/V2X-Seq-TFD/cooperative-vehicle-infrastructure \
--dataset V2X-Seq-TFD
# For V2X-Traj
python preprocess.py \
--root /path/to/v2x-traj \
--dataset V2X-Traj
Train or eval the model with different cooperation settings:
- V2X-Seq-TFD supports: ego/v2i
- V2X-Traj supports: ego/v2v/v2i/v2x
# For V2X-Seq-TFD
python train.py \
--root /path/to/V2X-Seq-TFD/cooperative-vehicle-infrastructure \
--dataset V2X-Seq-TFD \
--cooperation v2i
# For V2X-Traj
python train.py \
--root /path/to/v2x-traj \
--dataset V2X-Traj \
--cooperation v2x
# For V2X-Seq-TFD
python eval.py \
--root /path/to/V2X-Seq-TFD/cooperative-vehicle-infrastructure \
--dataset V2X-Seq-TFD \
--cooperation v2i \
--ckpt_path /path/to/V2X-Graph/checkpoints/v2x-seq-tfd/v2i.ckpt
# For V2X-Traj
python eval.py \
--root /path/to/v2x-traj \
--dataset V2X-Traj \
--cooperation v2x \
--ckpt_path /path/to/V2X-Graph/checkpoints/v2x-traj/v2x.ckpt
Metric | Ego | V2I |
---|---|---|
minADE | 1.16 | 1.05 |
minFDE | 2.02 | 1.79 |
MR | 0.30 | 0.25 |
Metric | Ego | V2V | V2I | V2X |
---|---|---|---|---|
minADE | 0.90 | 0.77 | 0.80 | 0.72 |
minFDE | 1.56 | 1.26 | 1.32 | 0.13 |
MR | 0.17 | 0.12 | 0.13 | 0.11 |
If you find this work useful in your research, please consider citing:
@inproceedings{ruan2024v2xgraph,
title={Learning Cooperative Trajectory Representations for Motion Forecasting},
author={Hongzhi Ruan and Haibao Yu and Wenxian Yang and Siqi Fan and Zaiqing Nie},
booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
year={2024}
}
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.