module

costs

module unitrack.costs

Cost producers and cost-side combinators.

Leaves consume a :class:`~unitrack.data.Tracklets` / :class:`~unitrack.data.Detections` pair and emit a :class:`~unitrack.data.CostExpression`. The lower-is-better convention holds throughout: a cost of ``0`` is a perfect match.

Members

module

  • combinatorsCost-side combinators: :class:`Weighted`, :class:`Reduce`, :class:`Sinkhorn`.
  • distanceDistance-based :class:`~unitrack.pipeline.CostProducer` leaves.
  • galleryGallery (feature-bank) cost — match a detection against a tracklet's history.
  • overlapIoU-family :class:`~unitrack.pipeline.CostProducer` leaves.

type

  • BiSoftmaxBi-directional softmax cost ``1 - 0.5 * (softmax_cs + softmax_ds)``.
  • BoxCIoU``1 - CIoU`` cost over a named bounding-box field (``xyxy`` format).
  • BoxGIoU``1 - GIoU`` cost over a named bounding-box field (``xyxy`` format).
  • BoxIoU``1 - IoU`` cost over a named bounding-box field (``xyxy`` format).
  • CDist``‖a - b‖_p`` distance over a named float-vector field.
  • ChamferSymmetric chamfer distance over a fixed-size point-cloud field.
  • Cosine``1 - cosine_similarity`` cost over a named float-vector field.
  • GalleryCostCosine cost between detections and each tracklet's embedding gallery.
  • MahalanobisMahalanobis squared distance ``(a - b)^T Σ^-1 (a - b)``.
  • MaskIoU``1 - IoU`` cost over a named boolean mask field.
  • RBFRBF-kernel cost ``1 - exp(-gamma * ‖a - b‖²)``.
  • ReduceCombine multiple child cost producers via a reduction.
  • ReductionReduction method for combining multiple cost matrices.
  • SinkhornSoft-OT renormalisation wrapper for the differentiable path.
  • WeightedScale a child cost producer's output by a scalar weight.

Source: unitrack/costs/__init__.py:1