Skip to main content

SORT tracker

Project description

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: ali.zarrinzadeh@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sort-tracker-1.0.7.tar.gz (27.1 kB view details)

Uploaded Source

File details

Details for the file sort-tracker-1.0.7.tar.gz.

File metadata

  • Download URL: sort-tracker-1.0.7.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9

File hashes

Hashes for sort-tracker-1.0.7.tar.gz
Algorithm Hash digest
SHA256 2b4f566e43e391766b5a00b38704f227d5502138fa74244a37c95919b185de0c
MD5 7b98015f501324aeb6d375ec23d69ffa
BLAKE2b-256 0b43cdf518c85b1f572dad672410a7a0af81ce9eaa140c9d58d02e093490a923

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page