Tsinghua-MARS-Lab / DenseTNT

MIT License
447 stars 117 forks source link

DenseTNT

Paper | Webpage

Argoverse Version

This branch is for Argoverse 2. Code for Argoverse 1 is at another branch.

Quick Start

Requires:

1) Install Packages

 pip install -r requirements.txt

2) Install Argoverse 2

Argoverse 2 requires Python ≥ 3.8

pip install av2

3) Compile Cython

Compile a .pyx file into a C file using Cython (already installed at step 1):

cd src/ && cython -a utils_cython.pyx && python setup.py build_ext --inplace && cd ../

Performance

Results on Argoverse 2:

brier-minFDE minADE minFDE MR
validation set 2.38 1.00 1.71 0.216

DenseTNT

1) Train

Suppose the training data of Argoverse motion forecasting is at ./data/train/.

OUTPUT_DIR=argoverse2.densetnt.1; \
GPU_NUM=8; \
python src/run.py --argoverse --argoverse2 --future_frame_num 60 \
  --do_train --data_dir data/train/ --output_dir ${OUTPUT_DIR} \
  --hidden_size 128 --train_batch_size 64 --use_map \
  --core_num 16 --use_centerline --distributed_training ${GPU_NUM} \
  --other_params \
    semantic_lane direction l1_loss \
    goals_2D enhance_global_graph subdivide goal_scoring laneGCN point_sub_graph \
    lane_scoring complete_traj complete_traj-3 \

2) Evaluate

Suppose the validation data of Argoverse motion forecasting is at ./data/val/.

3) Train Set Predictor (Optional)

Compared with the optimization algorithm (default setting), the set predictor has similar performance but faster inference speed.

After training DenseTNT, suppose the model path is at argoverse2.densetnt.1/model_save/model.16.bin. The command for training the set predictor is:

OUTPUT_DIR=argoverse2.densetnt.set_predict.1; \
MODEL_PATH=argoverse2.densetnt.1/model_save/model.16.bin; \
GPU_NUM=8; \
python src/run.py --argoverse --argoverse2 --future_frame_num 60 \
  --do_train --data_dir data/train/ --output_dir ${OUTPUT_DIR} \
  --hidden_size 128 --train_batch_size 64 --use_map \
  --core_num 16 --use_centerline --distributed_training ${GPU_NUM} \
  --other_params \
    semantic_lane direction l1_loss \
    goals_2D enhance_global_graph subdivide goal_scoring laneGCN point_sub_graph \
    lane_scoring complete_traj \
    set_predict=6 set_predict-6 data_ratio_per_epoch=0.4 set_predict-topk=0 set_predict-one_encoder set_predict-MRratio=0.0 \
    set_predict-train_recover=${MODEL_PATH} \

To evaluate the set predictor, just add --do_eval to the end of this training command.

Results of the set predictor on Argoverse 2:

brier-minFDE minADE minFDE MR
validation set 2.32 0.96 1.62 0.233

Citation

If you find our work useful for your research, please consider citing the paper:

@inproceedings{densetnt,
  title={Densetnt: End-to-end trajectory prediction from dense goal sets},
  author={Gu, Junru and Sun, Chen and Zhao, Hang},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={15303--15312},
  year={2021}
}