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:
- File -> Swift Packages -> Add Package Dependency
- add url: https://github.com/ShreshthSaxena/TrackSS/ and choose version/tag 1.0.0
- 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)
print(res)
}
-
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.
- Benchmark on provided datasets
- Add utility functions for Vision structs (CGRect/CGPoint)
- Add support for Carthage and Cocoapods
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