• Stars
    star
    244
  • Rank 165,856 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[ITS'21] Human Trajectory Forecasting in Crowds: A Deep Learning Perspective

TrajNet++ : The Trajectory Forecasting Framework

PyTorch implementation of Human Trajectory Forecasting in Crowds: A Deep Learning Perspective

docs/train/cover.png

TrajNet++ is a large scale interaction-centric trajectory forecasting benchmark comprising explicit agent-agent scenarios. Our framework provides proper indexing of trajectories by defining a hierarchy of trajectory categorization. In addition, we provide an extensive evaluation system to test the gathered methods for a fair comparison. In our evaluation, we go beyond the standard distance-based metrics and introduce novel metrics that measure the capability of a model to emulate pedestrian behavior in crowds. Finally, we provide code implementations of > 15 popular human trajectory forecasting baselines.

We host the Trajnet++ Challenge on AICrowd allowing researchers to objectively evaluate and benchmark trajectory forecasting models on interaction-centric data. We rely on the spirit of crowdsourcing and the challenge has > 1800 submissions. We encourage researchers to submit their sequences to TrajNet++, so the quality of trajectory forecasting models can keep increasing in tackling more challenging scenarios.

Data Setup

The detailed step-by-step procedure for setting up the TrajNet++ framework can be found here

Converting External Datasets

To convert external datasets into the TrajNet++ framework, refer to this guide

Training Models

LSTM

The training script and its help menu: python -m trajnetbaselines.lstm.trainer --help

Run Example

## Our Proposed D-LSTM
python -m trajnetbaselines.lstm.trainer --type directional --augment

## Social LSTM
python -m trajnetbaselines.lstm.trainer --type social --augment --n 16 --embedding_arch two_layer --layer_dims 1024

GAN

The training script and its help menu: python -m trajnetbaselines.sgan.trainer --help

Run Example

## Social GAN (L2 Loss + Adversarial Loss)
python -m trajnetbaselines.sgan.trainer --type directional --augment

## Social GAN (Variety Loss only)
python -m trajnetbaselines.sgan.trainer --type directional --augment --d_steps 0 --k 3

Evaluation

The evaluation script and its help menu: python -m evaluator.lstm.trajnet_evaluator --help

Run Example

## LSTM (saves model predictions. Useful for submission to TrajNet++ benchmark)
python -m evaluator.lstm.trajnet_evaluator --output OUTPUT_BLOCK/trajdata/lstm_directional_None.pkl --path <path_to_test_file>

## SGAN (saves model predictions. Useful for submission to TrajNet++ benchmark)
python -m evaluator.sgan.trajnet_evaluator --output OUTPUT_BLOCK/trajdata/sgan_directional_None.pkl --path <path_to_test_file>

More details regarding TrajNet++ evaluator are provided here

Evaluation on datasplits is based on the following categorization

Results

Unimodal Comparison of interaction encoder designs on interacting trajectories of TrajNet++ real world dataset. Errors reported are ADE / FDE in meters, collisions in mean % (std. dev. %) across 5 independent runs. Our goal is to reduce collisions in model predictions without compromising distance-based metrics.

Method ADE/FDE Collisions
LSTM 0.60/1.30 13.6 (0.2)
S-LSTM 0.53/1.14 6.7 (0.2)
S-Attn 0.56/1.21 9.0 (0.3)
S-GAN 0.64/1.40 6.9 (0.5)
D-LSTM (ours) 0.56/1.22 5.4 (0.3)

Interpreting Forecasting Models

docs/train/LRP.gif

Visualizations of the decision-making of social interaction modules using layer-wise relevance propagation (LRP). The darker the yellow circles, the more is the weight provided by the primary pedestrian (blue) to the corresponding neighbour (yellow).

Code implementation for explaining trajectory forecasting models using LRP can be found here

Benchmarking Models

We host the Trajnet++ Challenge on AICrowd allowing researchers to objectively evaluate and benchmark trajectory forecasting models on interaction-centric data. We rely on the spirit of crowdsourcing, and encourage researchers to submit their sequences to our benchmark, so the quality of trajectory forecasting models can keep increasing in tackling more challenging scenarios.

Citation

If you find this code useful in your research then please cite

@article{Kothari2020HumanTF,
  author={Kothari, Parth and Kreiss, Sven and Alahi, Alexandre},
  journal={IEEE Transactions on Intelligent Transportation Systems},
  title={Human Trajectory Forecasting in Crowds: A Deep Learning Perspective},
  year={2021},
  volume={},
  number={},
  pages={1-15},
  doi={10.1109/TITS.2021.3069362}
 }

More Repositories

1

CrowdNav

[ICRA19] Crowd-aware Robot Navigation with Attention-based Deep Reinforcement Learning
Python
583
star
2

monoloco

A 3D vision library from 2D keypoints: monocular and stereo 3D detection for humans, social distancing, and body orientation.
Python
420
star
3

UniTraj

A Unified Framework for scalable Vehicle Trajectory Prediction, ECCV 2024
Python
166
star
4

social-nce

[ICCV21] Official implementation of the "Social NCE: Contrastive Learning of Socially-aware Motion Representations" in PyTorch.
Python
157
star
5

s-attack

[CVPR 2022] S-attack library. Official implementation of two papers "Vehicle trajectory prediction works, but not everywhere" and "Are socially-aware trajectory prediction models really socially-aware?".
Python
105
star
6

causalmotion

[CVPR22] Towards Robust and Adaptive Motion Forecasting: A Causal Representation Perspective
Python
73
star
7

RRB

Official implementation of "Injecting Knowledge in Data-driven Vehicle Trajectory Predictors", Published in Transportation research part C.
Python
67
star
8

ttt-plus-plus

[NeurIPS21] TTT++: When Does Self-supervised Test-time Training Fail or Thrive?
Python
56
star
9

DePOSit

[ICRA 2023] Official implementation of "A generic diffusion-based approach for 3D human pose prediction in the wild".
Python
49
star
10

bounding-box-prediction

Bounding box prediction library. Official implementation of two papers on human 2D/3D bounding box prediction
Python
46
star
11

trajnetplusplustools

Tools for TrajNet++
Python
42
star
12

monstereo

MonoLoco++ and MonStereo for 3D localization, orientation, bounding box dimensions and social distancing from monocular and / or stereo images. PyTorch Official Implementation.
Python
39
star
13

social-transmotion

[ICLR 2024] Official implementation of "Social-Transmotion: Promptable Human Trajectory Prediction" in PyTorch.
Python
34
star
14

trajnetplusplusdata

Data for TrajNet++ Challenge
31
star
15

detection-attributes-fields

PyTorch implementation of "Detecting 32 Pedestrian Attributes for Autonomous Vehicles"
Python
31
star
16

looking

Python
30
star
17

trajnetplusplusdataset

Dataset Preparation for TrajNet++
Python
29
star
18

collaborative-gan-sampling

[AAAI20] TensorFlow implementation of the Collaborative Sampling in Generative Adversarial Networks
Python
24
star
19

decoupled-pose-prediction

Official implementation of "Learning Decoupled Representations for Human Pose Forecasting" in PyTorch
Python
19
star
20

Person-Re-Identification-with-Confidence

Python
18
star
21

motion-style-transfer

[CoRL22] Motion Style Transfer: Modular Low-Rank Adaptation for Deep Motion Forecasting
Python
17
star
22

SVGNet

The official implementation of "SVG-Net: An SVG-based Trajectory Prediction Model"
17
star
23

CIM

Causal Imitative Model official code
Python
14
star
24

openpifpaf_wholebody

PifPaf extension to detect body, foot, face and hand keypoints.
Python
13
star
25

unposed

[RA-L 2024] Official implementation of "Toward Reliable Human Pose Forecasting with Uncertainty"
Python
13
star
26

rock-pytorch

A PyTorch implementation of "Revisiting Multi-Task Learning with ROCK: a Deep Residual Auxiliary Block for Visual Detection"
Python
12
star
27

hybrid-feature-fusion

Python
11
star
28

butterflydetector

Python
9
star
29

pedestrian-transition-dataset

Jupyter Notebook
9
star
30

DLAV-2022

EPFL Deep Learning for Autonomous Vehicles, Spring 2022
Jupyter Notebook
9
star
31

SemDisc

Official implementation of "A Shared Representation for Photorealistic Driving Simulators" in PyTorch.
Python
9
star
32

JRDB-Traj

JRDB dataset: trajectory prediction baselines and data preprocessing
Python
8
star
33

introML-2021

EPFL Introduction to Machine Learning for Engineers, Spring 2021
Jupyter Notebook
7
star
34

SGG-CoRF

Python
7
star
35

CODE

Implementation of CODE: Confident Ordinary Differential Editing
Jupyter Notebook
6
star
36

IntroML-2024

Jupyter Notebook
6
star
37

DLAV-2023

Jupyter Notebook
5
star
38

introML-2023

Jupyter Notebook
5
star
39

Deep-Visual-Re-Identification-with-Confidence

Python
5
star
40

pose-action-recognition

Python
5
star
41

TIC-TAC

[ICML 2024] Code repository for "TIC-TAC: A Framework for Improved Covariance Estimation in Deep Heteroscedastic Regression". We address the problem of sub-optimal covariance estimation in deep heteroscedastic regression by proposing a new model and metric.
Python
5
star
42

openpifpaf-torchhub

Pretrained models for OpenPifPaf via torchhub.
4
star
43

openpifpaf_animalpose

Python
3
star
44

trajnetplusplus-model-zoo

TrajNet++ Model Zoo is a collection of pre-trained models on the TrajNet++ Benchmark
2
star
45

unitraj-DLAV

The UniTraj framework, developed by VITA, adjusted for the project of DLAV course.
Python
2
star
46

DLAV-2024

Jupyter Notebook
2
star
47

introML-2022

EPFL Introduction to Machine Learning for Engineers, Spring 2022
Jupyter Notebook
1
star
48

IncrementalHumanPose

Python
1
star
49

code_template

A repository displaying a possible code structure suitable for Slurm
Python
1
star