Project Page - https://gamma.umd.edu/spectralcows
Please cite our work if you found it useful.
@article{chandra2019forecasting,
title={Forecasting Trajectory and Behavior of Road-Agents Using Spectral Clustering in Graph-LSTMs},
author={Chandra, Rohan and Guan, Tianrui and Panuganti, Srujan and Mittal, Trisha and Bhattacharya, Uttaran and Bera, Aniket and Manocha, Dinesh},
journal={arXiv preprint arXiv:1912.01118},
year={2019}
}
Since this is a research codebase and maintained by students, this repo is under active maintenance. Do let us know of any issues you may encounter and we will do our best to resolve them :) A list of known bugs with solutions is regularly maintained and compiled here, and optimizations/enhancements to the code are compiled here.
Python version: 3.7
-
Create a conda environement
conda env create -f env.yml
-
To activate the environment:
conda activate sc-glstm
-
Download resources
python setup.py
- To run our one & two stream model:
cd ours/
python main.py
- To change between one stream to two stream, simply change the variable
s1
in main.py between True and False. - To change the model, change
DATA
andSUFIX
variable in main.py.
- To run EncDec comparison methods:
cd comparison_methods/EncDec/
python main.py
- To change the model, change
DATA
andSUFIX
variable in main.py.
- To run GRIP comparison methods:
cd comparison_methods/GRIP/
python main.py
- To change the model, change
DATA
andSUFIX
variable in main.py.
- To run TraPHic/SC-LSTM comparison methods:
cd comparison_methods/traphic_sconv/
python main.py
- To change the model and methods, change
DATASET
andPREDALGO
variable in main.py.
Note: During evaluation of the trained_models, the best results may be different from reported error due to different batch normalization applied to the network. To obtain the same number, we may have to mannually change the network.
Please cite the methods below if you use them.
- TraPHic: Trajectory Prediction in Dense and Heterogeneous Traffic Using Weighted Interactions, CVPR'19
Rohan Chandra, Uttaran Bhattacharya, Aniket Bera, Dinesh Manocha. - Convolutional Social Pooling for Vehicle Trajectory Prediction, CVPRW'18
Nachiket Deo and Mohan M. Trivedi. - Social GAN: Socially Acceptable Trajectories with Generative Adversarial Networks, CVPR'18
Agrim Gupta, Justin Johnson, Fei-Fei Li, Silvio Savarese, Alexandre Alahi. - GRIP: Graph-based Interaction-aware Trajectory Prediction, ITSC'19
Xin Li, Xiaowen Ying, Mooi Choo Chuah
As the official implementation of the GRIP method is not available, the code provided here is our own effort to replicate the GRIP method to the best of our ability and does not necessarily convey the original implementation of the authors. Please contact the authors directly for the original implementation.
Additionally, the graph construction part of GRIP may be slow as the code does not exploit optimized data structures and algorithms. If anyone uses the GRIP code and can come up with an optimized way to reduce computational time, please consider creating a pull request and we will acknoledge your contributions here ! :)
- data -- input and output of stream 1 & 2 (This is directly avaiable in resources folder)
- raw_data -- location of the raw data (put the downloaded dataset in this folder to process)
- trained_model -- some saved models
Important steps if you plan to prepare the data from the raw data
- Run
data_processing/format_apolloscape.py
to format the downloaded apolloscape data into our desired representation - Run
data_processing/format_lyft.py
to format the downloaded lyft data into our desired representation - Run
data_processing/generate_data.py
to format the downloaded Argoverse trajectory data into our desired representation
- Use
data_processing/data_stream.py
to generate input data for stream1 and stream2. - Use
generate_adjacency()
function indata_processing/behaviors.py
to generate adjacency matrices. - Must use
add_behaviors_stream2()
function indata_processing/behaviors.py
to add behavior labels to the stream2 data before supplying the data to the network.
- use the
plot_behaviors()
function indata_processing/behaviors.py
to plot the behaviors of the agents.