Swiftpack.co - ShreshthSaxena/TrackSS as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ShreshthSaxena.
ShreshthSaxena/TrackSS 1.0.0
Lightweight Swift package for adding real-time object tracking to any detector.
⭐️ 15
🕓 2 weeks ago
.package(url: "https://github.com/ShreshthSaxena/TrackSS.git", from: "1.0.0")


SORT based Tracker for real-time Object Tracking in Swift
for author's Python implementation check : https://github.com/abewley/sort
for associated object detection in Swift check: https://github.com/ShreshthSaxena/Object-Detection-iOS-Swift


SORT is a barebones implementation of a visual multiple object tracking framework based on rudimentary data association and state estimation techniques. It is designed for online tracking applications where only past and current frames are available and the method produces object identities on the fly. While this minimalistic tracker doesn't handle occlusion or re-entering objects its purpose is to serve as a baseline and testbed for the development of future trackers.

SORT was initially described in this paper. At the time of the initial publication, SORT was ranked the best open source multiple object tracker on the MOT benchmark.

Dependency Credits:


To add package in your Xcode project do:


  • Create a Tracker object:

let T = TrackerSS()

  • Update tracker with detections on each timestep/frame:

for f in frames{
let res = T.update(dets: f)

  • Input parameter dets: Array<Array<Int>> is an array of detections in the format [[x1,y1,x2,y2],[x1,y1,x2,y2],...]

  • Output returned is a similar 2d-array appended with object ID in last column.

To do

  • ☑ Benchmark on provided datasets
  • ☐ Add utility functions for Vision structs (CGRect/CGPoint)
  • ☐ Add support for Carthage and Cocoapods

Test outputs

Results of author's Python version and this Swift implementation on provided dataset (data folder) on Core-i5 MBP-2019.

Python output:

Processing ETH-Bahnhof.
Processing ADL-Rundle-8.
Processing ADL-Rundle-6.
Processing ETH-Pedcross2.
Processing TUD-Stadtmitte.
Processing TUD-Campus.
Processing KITTI-17.
Processing PETS09-S2L1.
Processing Venice-2.
Processing ETH-Sunnyday.
Processing KITTI-13.
Total Tracking took: 6.033 seconds for 5500 frames or 911.6 FPS

Swift(Xcode) output:

processing ADL-Rundle-6.txt
processing TUD-Campus.txt
processing ETH-Sunnyday.txt
processing KITTI-17.txt
processing ETH-Pedcross2.txt
processing KITTI-13.txt
processing TUD-Stadtmitte.txt
processing Venice-2.txt
processing PETS09-S2L1.txt
processing ETH-Bahnhof.txt
processing ADL-Rundle-8.txt
Total Tracking took: 8.434 seconds for 5500 frames or 652.14 FPS


Stars: 15
Last commit: 2 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

3 years ago

stable version 1

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics