A minimal implementation of SORT (Simple Online and Realtime Tracking) for multi-object tracking using Kalman filtering and Hungarian algorithm.
pip install -r requirements.txtimport numpy as np
from sort import SORT
tracker = SORT(max_age=30, min_hits=3, iou_threshold=0.3)
# detections: numpy array of shape (N, 5) -> [x1, y1, x2, y2, score]
detections = np.array([[100, 100, 200, 200, 0.9], [300, 300, 400, 400, 0.8]])
# tracks: numpy array of shape (M, 5) -> [x1, y1, x2, y2, track_id]
tracks = tracker.update(detections)Face tracking demo using UniFace for detection:
python demo.py --source 0 # webcam
python demo.py --source video.mp4 --save output.mp4- SORT: abewley/sort - Original implementation
- UniFace: yakhyo/uniface - Face detection library