Giter Club home page Giter Club logo

sort-python's Introduction

SORT-PYTHON

Python module bindings for SORT algorithm (Simple, Online, and Realtime Tracking) implemented in C++, with the goal of being fast and easy to use. Tracker is based on this repo.

Installation

Before you can install the package, you need to install the following dependencies:

$ sudo apt install libopencv-dev
$ sudo apt install libeigen3-dev

Make sure pip is upgraded to last version:

$ pip install pip --upgrade

Then you can install the package using:

$ pip install sort-tracker

or

$ git clone https://github.com/MrGolden1/sort-python.git
$ cd sort-python
$ pip install .

Usage

import sort
# Create a tracker with max_age = 5, min_hits = 3 and iou_threshold = 0.2
# Default values are max_age = 3, min_hits = 1 and iou_threshold = 0.3
tracker = sort.SORT(max_age=5, min_hits=3, iou_threshold=0.2)

Methods:

Two main methods are available named run and get_tracks and you can specify format of input and output bounding boxes as follows:

# format (int):
#    0: [xmin, ymin, w, h]
#    1: [xcenter, ycenter, w, h]
#    2: [xmin, ymin, xmax, ymax]

defaulf format is 0.

run

run method takes an array of bounding boxes and format, and then performs tracking.

# Input:
#   bounding_boxes: a numpy array of bounding boxes [n, 4]
#   format: format of bounding boxes (int)
import numpy as np
bounding_boxes = np.array([[10, 10, 20, 20], [30, 30, 40, 40]])
tracker.run(bounding_boxes, 0)

get_tracks

get_tracks method returns a array of tracks.

# Input:
#   format: format of bounding boxes (int)
# Output:
#   tracks: a numpy array of tracks [n, 5] where n is the number of tracks
#       and 5 is (id, ..., ..., ..., ...) where id is the track id and ... is the bounding box in the specified format
tracks = tracker.get_tracks(0)

Demo

demo

Author: MrGolden1

Email: [email protected]

sort-python's People

Contributors

mrgolden1 avatar youngjaedev 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.