Giter VIP home page Giter VIP logo

mtn_trajectory's Introduction

MTN_trajectory: Multimodal Transformer Networks for Pedestrian Trajectory Prediction

logo

😎PyTorch(1.6.0) training, evaluating models for MTN_trajectory. For details see Multimodal Transformer Networks for Pedestrian Trajectory Prediction by Ziyi Yin, Ruijin Liu, Zhiliang Xiong, Zejian Yuan.

Data Preparation

  • PIE Dataset

Enter the PIE directory.

cd path/to/MTN_trajectory/PIE/

Download and extract PIE dataset:

git clone https://github.com/aras62/PIE.git
mv PIE PIE_dataset
unzip -d PIE_dataset/ PIE_dataset/annotations.zip
unzip -d PIE_dataset/ PIE_dataset/annotations_attributes.zip
unzip -d PIE_dataset/ PIE_dataset/annotations_vehicle.zip
mv PIE_dataset/pie_data.py ./

Download and extract optical flow representations of PIE from google drive. We expect the directory structure to be follwing:

path/to/MTN_trajectory/
    PIE/
        PIE_dataset/
        PIE_model/
        flow/
        transformer/
        pie_data.py
        individual_TF.py
        baselineUtils.py
        train_pie.py
        test_pie.py
    JAAD/
  • JAAD Dataset

Enter the JAAD directory.

cd path/to/MTN_trajectory/JAAD/

Download and extract JAAD dataset:

git clone https://github.com/ykotseruba/JAAD.git
mv JAAD JAAD_dataset
mv JAAD_dataset/jaad_data.py ./

Download and extract optical flow representations of JAAD from google drive. We expect the directory structure to be follwing:

path/to/MTN_trajectory/
    PIE/
    JAAD/
        JAAD_dataset/
        JAAD_model/
        flow/
        transformer/
        jaad_data.py
        individual_TF.py
        baselineUtils.py
        train_jaad.py
        test_jaad.py

Set Envirionment

  • Linux ubuntu 16.04
conda create -n MTN python=3.7.9

After you create the environment, activate it

conda activate MTN 

Then

pip install torch==1.6.0+cu92 torchvision==0.7.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
pip install numpy==1.19.4
pip install scikit-learn==0.23.2
pip install opencv-python==4.4.0.46
pip install tqdm

Training and Evaluation

  • on PIE Dataset

To train a model on PIE dataset, run following codes:

cd path/to/MTN_trajectory/PIE
python train_pie.py

Saved model files (every 10 epoches) are in ./PIE_model during training.

To evaluate, run:

python test_pie.py
  • on JAAD Dataset

To train a model on JAAD dataset, run following codes:

cd path/to/MTN_trajectory/JAAD
python train_jaad.py

Saved model files (every 10 epoches) are in ./JAAD_model during training.

To evaluate, run:

python test_jaad.py

You can test your own model by setting model_path in test_jaad.py or test_pie.py. According to our experiments, the test result from each training model may have slight differences as distinct initializations and GPU settings. On PIE dataset, the MSE results are taken from 440 to 460. On JAAD dataset, the MSE results are taken from 995 to 1030.

Citation

@InProceedings{MTN_trajectory,
author = {Ziyi Yin and Ruijin Liu and Zhiliang Xiong and Zejian Yuan},
title = {Multimodal Transformer Networks for Pedestrian Trajectory Prediction},
booktitle = {IJCAI},
year = {2021}
}

License

MTN_trajectory is released under BSD 3-Clause License. Please see LICENSE file for more information.

Acknowledgements

PIE dataset

JAAD dataset

Trajectory-Transformer

RAFT

mtn_trajectory's People

Contributors

ericyinyzy avatar

Stargazers

Wei Ziang avatar  avatar  avatar  avatar wangdongdan  avatar Rachid Ben abdelmalek avatar  avatar  avatar HengLiu avatar Jeeye avatar R. Erdem avatar  avatar xiaofei zhang avatar Psychic avatar  avatar liuh avatar  avatar Murad Mebrahtu avatar Ziyang SONG  avatar zhouyang avatar Biao Yang avatar

Watchers

 avatar

mtn_trajectory's Issues

Fine-graind fusion issue

I noticed that you used a frame of 45 for fine-grained processing, but the input length for optical flow data is 14. Shouldn't you enter a length of '45-1'?
the code: enc_extra_ped = ped_op_flow[:, :(inp_l - 1)].reshape(ped_op_flow.shape[0], 2 * (inp_l - 1), -1).to(device)

Images / Data Loader

Hello,
You don't use images in your approach please? How did you get it from videos and where is the file of images obtained in this case please?

Another question, I don't really understand your data Loader! Can you give more details please?

Thanks!

Little GPU-util

I check the gpu-util when I run the code, while it reminds 4%?

Optical flow processing code

Hello, author, can you open source the code of optical flow processing? I would like to do experiments on other data sets. If possible, I would be very grateful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.