Giter Club home page Giter Club logo

trackjectory's Introduction

TrackJectory

Tracking and Trajectory Prediction

Components Implemented :-

  1. Siamese Tracker for single object (online) visual tracking. Provided the template image, SiamRPN++ identify's and track's the template across video frames.
  2. FairMOT for one shot multi-object detection and tracking. (FairMOT: Multi-Object Tracking)
  3. Social GCN for trajectory forecasting. FairMOT is used to predict and track multiple objects across frames. After extracting the tracked objects, those outputs are furnished to Social GCN to forecast the trajectories.

Installation and Running

Installation

  1. Run following to clone into local system https://github.com/Sai-Venky/Trackjectory.git.
  2. Create conda environment conda create --name track python=3.6 and activate it conda activate track.
  3. Run pip install -r requirements.txt.
  4. Run pip install lap cython-bbox
  5. Setup DCNv2 by going into cd DCNV2 and running sh ./make.sh.

Running - Training and Testing

All configurable values with details on their significance are in utils/config.py. For testing, pre-trained models can be downloaded from
Siam RPN++
FairMOT DLA-34

Single Object Tracking :-
Training - python src/siam_train.py
Testing - python src/siam_track.py

Multi Object Tracking :-
Training - python src/mot_train.py
Testing - python src/mot_track.py

Trajectory Forcasting :-
Training - python src/trajectory_train.py
Testing - python src/trajectory_test.py

Dataset

The dataset is created from Kabaddi player videos curated from multiple online platforms. (https://youtu.be/HOfY9g05Sv4) This was selected since this sport depicts a lot of movements (feints) and is challenging for forcasting trajectory correctly.

In order to train with a custom dataset, change the config value of multi_images_dataset, single_track_dataset, trajectory_dataset in utils/config.py. The samples of how data should be constructed is provided in the data folder.

Directory Layout

The directory structure is as follows :-

  • dataset : contains the necessary files needed for loading the Siamese, MOT and Trajectory forcasting datasets along with transformation functions.
    • mot_dataset : training/validation and testing base class which instantiates the fairmot dataset and transforms the raw data with affine transformation.
    • siam_dataset : training/validation base class which instantiates the siamese dataset and returns the template with target frame.
    • trajectory_dataset : training/validation base class which instantiates the trajectory dataset after constructing the graph based on tracked objects and frame sequences.
    • util : helper functions for preprocessing the image.
  • models : this contains the base models for TrackJectory with all of its constituent methods.
    • gcn : contains the social graph cnn model with time extrapolator cnn.
    • pose_dla_dcn : contains the dla-34 model with deformable convolutions initialization.
    • single_track : contains the siam rpn++ model (resnet) with depthwise correlation.
    • loss : contains the mot, bivariate and L1 loss functions.
  • utils : this contains the utility methods for TrackJectory.
    • config : contains the configuration options.
    • scheduler : contains the scheduler options for adjusting learning rate dynamically.
    • utils : contains the load, save model functions for TrackJectory.
    • decode : contains the util functions for extracting the feasible outputs during multiple object tracking.
  • tracker : this contains the tracker instantiations for performing live inference.
    • basetrack : the base class for multi object tracking.
    • matching : contains the methods needed for fusing the iou, embedding and Kalman Filter (KF) outputs.
    • multitracker : implementation of Joint Detection and Embedding (JDE) tracker for performing multi object tracking and association.
    • singletracker : implementation of a SiamRPN++ tracker for performing single object tracking.
  • tracking_utils : this contains the utils needed for the multi object tracker.
    • kalman_filter : contains the methods for predicting, updating KF values and computing gating distance between KF outputs and embedding distance.
    • log : logger functions.
    • timer : timer functions.
    • visualization : methods for visualizing the multiple outputs predicted by JDE tracker.
  • mot_track : main file performing tasks for tracking multiple objects and creating the inputs for trajectory forcasting.
  • mot_train : main file performing tasks for training FairMOT.
  • siam_track : main file performing tasks for tracking a single object.
  • siam_train : main file performing tasks for training SiamRPN++.
  • trajectory_test : main file performing tasks for testing Social GCN and visualization functions for forming the trajectories based on outputs.
  • trajectory_train : main file performing tasks for training Social GCN with outputs predicted from multi object tracker.

Results

Multi Object Tracking

Multi Object Tracking

Trajectory Forcasting Output

Trajectory Forcasting Output

Single Object Tracking Output and Template

Single Object Tracking Output   Single Object Tracking Template

Acknowledgement

Thanks a lot for the wonderful work. The above pre-trained models are taken from the respective links.

https://github.com/ifzhang/FairMOT
https://github.com/zllrunning/SiameseX.PyTorch
https://github.com/abduallahmohamed/Social-STGCNN

Contributing

You can contribute in serveral ways such as creating new features, improving documentation etc.

Licence

MIT Licence

trackjectory's People

Contributors

sai-venky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

trackjectory's Issues

Fairmot

Hello , I have gone through your code and I want to know how you created a dataset for fairmot?

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.