Giter VIP home page Giter VIP logo

socialways's Introduction

Social Ways

The pytorch implementation for the paper

Social Ways: Learning Multi-Modal Distributions of Pedestrian Trajectories with GANs
Javad Amirian, Jean-Bernard Hayet, Julien Pettre
Presented at CVPR 2019 in Precognition Workshop ( [arxiv], [slides], [poster] )

This work is, theoretically, an improvement of Social-GAN by applying the following changes:

  1. Implementing Attention Pooling, instead of Max-Pooling
  2. Introducing to use new social features between pair of agents:
  • Bearing angle
  • Euclidean Distance
  • Distance to Closest Approach (DCA)
  1. Replacing L2 loss function with Information loss, an idea inspired by info-GAN

System Architecture

The system is composed of two main components: Trajectory Generator and Trajectory Discriminator. For generating a prediction sample for Pedestrian of Interest (POI), the generator needs the following inputs:

  • the observed trajectory of POI,
  • the observed trajectory of surrounding agents,
  • the noise signal (z),
  • and the latent codes (c)

The Discriminator takes a pair of observation and prediction samples and decides, if the given prediction sample is real or fake.

Toy Example

We designed the trajectory toy dataset, to assess the capability of generator in preserving modes of trajectory distribution. There are six groups of trajectories, all starting from one specific point located along a circle (blue dots). When approaching the circle center, they split into 3 subgroups. Their endpoints are the green dots.

In order to create the toy example trajectories, you need to run

$ python3 create_toy.py --npz [output file]

this will store the required data into a .npz file. The default parameters are:

n_conditions = 8
n_modes = 3
n_samples = 768  

You can also store the raw trajectories into a .txt file with the following command:

$ python3 create_toy.py --txt [output file]

For having fun and seeing the animation of toy agents you can call:

$ python3 create_toy.py --anim

How to Train

To train the model, please edit the train.py to select the dataset you want to train the model on. The next few lines define some of the most critical parameters values. Then execute:

$ python3 train.py

How to Visualize Results

$ python3 visualize.py

How to Setup

How to Cite

If you are using this code for your work, please cite:

@inproceedings{amirian2019social,
  title={Social ways: Learning multi-modal distributions of pedestrian trajectories with GANs},
  author={Amirian, Javad and Hayet, Jean-Bernard and Pettr{\'e}, Julien},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW)},
  pages={0--0},
  year={2019}
}

socialways's People

Contributors

amiryanj avatar jbhayet avatar

Watchers

James Cloos avatar

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.