trackforge / utils / features
Module features
Appearance-feature helpers shared by the Re-ID trackers.
DeepSORT's feature gallery and BoT-SORT's per-track embedding both need the same two operations: L2-normalise a vector and measure the cosine distance between two vectors. They live here so there is one tested implementation.
Quick Reference
| Item | Kind | Description |
|---|---|---|
cosine_distance |
fn | Cosine distance between two vectors, in [0, 2]. |
l2_normalize |
fn | L2-normalise a feature vector. |
Functions
cosine_distance
Cosine distance between two vectors, in [0, 2].
Each vector is normalised internally, so the inputs need not be unit length.
Identical directions give 0, orthogonal give 1, opposite give 2. A
zero-norm input yields 1 (no similarity).
l2_normalize
L2-normalise a feature vector.
A zero (or near-zero) vector is returned unchanged, so callers never divide by zero.