costs.GalleryCost
class GalleryCost:Cosine cost between detections and each tracklet's embedding gallery.
For tracklet gallery ``(N, K, D)`` and detections ``(M, D)``, computes
the cosine similarity ``(N, K, M)``, masks gallery slots that are not
yet filled (per the count field), reduces over the ``K`` slots, and
returns ``1 - similarity`` as an ``(N, M)`` cost.
Parameters
| Name | Type | Description |
|---|---|---|
| gallery_field | str | Tracklet field holding the ``(N, K, D)`` gallery buffer. |
| count_field | str | Tracklet field holding the ``(N,)`` fill count (number of appends). |
| field | str | Detection field holding the ``(M, D)`` query embedding. |
| reduce = "max" | ('max', 'mean') | Slot reduction. ``"max"`` takes the best-matching historical view (robust to appearance change); ``"mean"`` averages valid slots. |
| eps = 1e-12 | float | Lower bound on the L2 norm used for normalisation. |
Raises
- ValueError — If ``reduce`` is not ``"max"`` or ``"mean"``.
Members
Source: unitrack/costs/gallery.py:30