Skip to content
Fujiry0Public

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Towards Predicting Any Human Trajectory In Context (NeurIPS 2025)

[Paper] [Project Page] [Poster]

This is the official code release for our NeurIPS 2025 paper "Towards Predicting Any Human Trajectory In Context".

🔍 TrajICL

TrajICL

Predicting accurate future trajectories requires adaptability, yet fine-tuning for each new scenario is often impractical for edge deployment. To address this, we introduce TrajICL, an In-Context Learning (ICL) framework for pedestrian trajectory prediction that enables robust adaptation to diverse environments at inference time without requiring weight updates.

Our TrajICL implementation includes the following key features:

  • Spatio-Temporal Similarity-based Example Selection (STES): Selects relevant examples from observed trajectories by identifying similar motion patterns at corresponding locations within the same scene.
  • Prediction-Guided Example Selection (PG-ES): Refines example selection by utilizing both past and predicted future trajectories to account for long-term dynamics.
  • Superior Adaptation & Generalization: Leverages large-scale synthetic training to achieve remarkable adaptation, outperforming even fine-tuned approaches across in-domain and cross-domain benchmarks.

📂 Data Preparation

Download MOTSynth dataset

bash bash scripts/donwnload.sh

Run Preprocessing Code

bash bash scripts/preprocess.sh

🔥 Training

1. Vanilla trajectory prediction (VTP) training

VTP checkpoints are saved in results/TrajICL.

python train.py

2. In-context training

For load_model.model_path, please specify the relative path (inside the results/TrajICL directory) to the checkpoint saved during VTP training.

Example: If the full path is results/TrajICL/robust-sunset-33/best_val_checkpoint.pth.tar, you should set load_model.model_path to robust-sunset-33/best_val_checkpoint.pth.tar.

python train.py -m training.epochs=400 training.warmup_steps=12 dataset.num_example=8 load_model.model_path=robust-sunset-33/best_val_checkpoint.pth.tar

⚠️ Note: The path robust-sunset-33/best_val_checkpoint.pth.tar shown in the -m option above is just an example. Please modify this value to match the actual checkpoint path generated after running the VTP training (Step 1).

🔍 Evaluation

python eval.py

👏 Acknowledgement

We sincerely thank the authors of Social-Transmotion for providing their source code, which has been invaluable to our work. We are immensely grateful for their contribution.

✍️ Citation

If you use this code for your research, please cite our paper.

@inproceedings{
  fujii2026towards,
  title={Towards Predicting Any Human Trajectory In Context},
  author={Ryo Fujii and Hideo Saito and Ryo Hachiuma},
  booktitle={The Thirty-ninth Annual Conference on Neural Information Processing Systems},
  year={2026},
  url={https://openreview.net/forum?id=qB1UKvjO0N}
}

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages