Code Monkey home page Code Monkey logo

sigmaister / acurustrack-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timofeykruk/acurustrack

4.0 0.0 1.0 118.86 MB

A multi-object tracking component. Works in the conditions where identification and classical object trackers don't (e.g. shaky/unstable camera footage, occlusions, motion blur, covered faces, etc.). Works on any object despite their nature.

Home Page: https://aihunters.com/blogs/how-we-track-identical-objects-with-the-probabilistic-data-association-approach.html

License: GNU General Public License v3.0

Python 100.00%

acurustrack-1's Introduction

AcurusTrack. Python data association component for precise multi-object tracking

AcurusTrack is a highly predictable multiple object tracker. It is based on a custom data association approach.

This component does not depend on objects' nature - we work with arbitrary ones. You can serve any metadata as input. Here we display the examples of the metadata derived by face and pose estimators. You can use any of the estimators you prefer to create the data for input.

This repository is a work of AIHunters.

We got inspired by the article describing the Markov chain Monte Carlo data association. For fairly simple cases we're releasing this slightly shorter version. But if you are interested in a full version, or have business cases for any of the two versions, feel free to contact us at [email protected] for more information.

Pipeline conceptual representation

Use Cases

  • Complicated multi-occlusion movement

  • Medical face masks

  • Identically-dressed people with faces fully covered

  • People in identical military uniform

  • Visitor analytics for physical locations

  • Feel free to suggest yours

First Time Setup:

git clone https://github.com/AIHunters/AcurusTrack.git
cd AcurusTrack
sudo apt-get install python-virtualenv
virtualenv venv --system-site-packages
source venv/bin/activate
pip install -r requirements.txt

Enter the virtualenv in a later session to use the installed libraries

source venv/bin/activate

To exit the virtualenv

deactivate

Input data should have the following form:

{"frame_no": [{"x1": top_right_x, "y1": top_right_y, "x2": bottom_left_x, "y2": bottom_left_y}], "frame_no":[],...}

in case of face processing (for face meta extraction we used RetinaFace)

{"frame_no": [{"body_part_name_x": x_coord, "body_part_name_y": y_coord, "body_part_name_x": x_coord, "body_part_name_y": y_coord}], "frame_no":[],...}

in case of body processing (for pose meta extraction we used OpenPose, and you can use any pose estimator you want). More information about the parameters you can find in config.py

Clean the data

To enhance accuracy, we recommend using the EvenVizion component which allows transfer to a fixed coordinate system. If you choose to use it:

  • navigate to the FCS;
  • create a separate environment for the EvenVizion setup;
  • use run_EvenVizion.py to get json with with homography matrices;
  • run AcurusTrack, setting fixed_coordinate_system = True beforehand.

Project structure (main files):

  • run.py - main file for running algorithm
  • pipeline.py - pipeline, including splitting video on chunks, processing them individually, merging results, running final merge algorithm
  • config.py - parameters that define overall pipeline
  • FCS
  • processing
  • track
    • tracker.py - contain abstract class AbstractTracker, realizing full pipeline.
    • tracker_merger.py - contain class TrackerMerger for simplified pipeline.
  • initialisation - meta preprocessing based on some similarity metric
  • additional - auxiliary file with modified Kalman filter.
  • utils - custom useful functions
  • examples - demo scripts
  • visualization - folder containing all visualization functions
    • make_video_with_meta.py - visualize algorithm result

      • using face meta

      face_visualization

      • using pose meta

      pose_visualization

    • visualization.py - functions for custom meta visualization meta_visualization

Run the analysis

$python3 run.py --detections [json containing detections] --video_path --video_name --exp_name --path_to_homography_dict optionally --start_frame optionlly --end_frame optionally

Accuracy comparison

We decided to compare our AcurusTrack component (right) with one of the popular trackers - Re3 (left).

  • Identically-dressed people with faces fully covered

  • Medical face masks

As you can see, the accuracy is higher when using AcurusTrack (especially in the presence of occlusions and camera movement).

Important notice

  • Please NOTE that we have changed a source code of the filterpy library slightly, you can find it at the repository.
  • Pay close attention to the configurable parameters as they include important control features.

Latest updates

Single-shot multi-object tracking was added in the latest release AS AN EXPERIMENT. You can try using it for your cases.

License

AcurusTrack is licensed under the GNU General Public License, either version 3 of the License, or (at your option) any later version. All the third-party open-source software used in this project is listed in Third-Party Open Source Software Notice together with the according licenses.

https://github.com/AIHunters/AcurusTrack

Send us your feedback

We're open to any kind of communication, whether it is your feedback, failure cases, possible improvements or cooperation possibilities. Contact us at [email protected].

Please adhere to our CODE_OF_CONDUCT to keep positive and constructive environment here.

acurustrack-1's People

Stargazers

 avatar  avatar  avatar  avatar

Forkers

windmark9

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.