Skip to content

DeepOcSort

Paper: Deep OC-SORT: Multi-Pedestrian Tracking by Adaptive Re-Identification

DeepOcSort combines observation-centric motion with appearance association. Its adaptive weighting controls the contribution of embeddings, while camera-motion compensation handles motion shared across the image.

Tasks and variants

Task Default variant Other variants
2D boxes (AABB) AABB + ReID Motion-only
Oriented boxes (OBB) OBB + ReID Motion-only

Set use_embeddings=False in the tracker config to select motion-only association. Camera-motion compensation and frame requirements apply independently.

Python AABB mode also supports optional EdgeTAM mask guidance with --tracker deepocsort --tracker-backend python --asso-func iou --edgetam --mask-guidance-weights edgetam.pt. It requires IoU association and per_class=False, retains this tracker's existing association rules, and adds temporal model inference. Accuracy gains have not been established for this extension.

What BoxMOT Needs For DeepOcSort

  • A detector plus appearance embeddings when use_embeddings=True. The Python implementation can generate missing embeddings from a supplied Frame or consume embeddings already attached to Detections.
  • Supports both AABB and OBB detections in BoxMOT.
  • Useful when OC-SORT is close but still loses IDs in crowded scenes where appearance recovery matters.

Direct construction accepts reid=ReIDConfig(...) or a prebuilt AppearanceEncoder, as described in the Python API.

Camera motion compensation

DeepOCSORT enables sparse optical flow camera compensation by default through DeepOcSortConfig(use_cmc=True, cmc_method="sof"). Disable it with DeepOcSortConfig(use_cmc=False), or save a runtime profile:

tracker: deepocsort
use_cmc: false

Pass the profile with --tracker-config path/to/profile.yaml. Current image pixels are required while CMC is enabled, even with precomputed embeddings. use_embeddings=False disables appearance independently; disable both features for detections-only updates, unless centroid association or mask guidance requires a frame.

For joint camera/filter selection, use tune --tracker deepocsort --select-kf --select-cmc; see Kalman calibration.

Python API

Pass algorithm settings through DeepOcSortConfig, for example DeepOcSort(config=DeepOcSortConfig(det_thresh=0.5)). Direct construction and create_tracker("deepocsort") use the same algorithm defaults. See the tracker configuration guide for presets and component settings.

Bases: TrackerConfig

Configure motion-direction matching and adaptive appearance weighting.

Shared history and association settings are inherited from TrackerConfig.

Parameters:

  • motion_fusion (str, default: 'off' ) –

    First-pass Kalman association mode: off, gate, or blend.

  • motion_fusion_lambda (float, default: 0.98 ) –

    Existing-cost weight when motion fusion blends costs.

  • motion_fusion_only_position (bool, default: False ) –

    Gate centers instead of full box geometry.

  • fuse_detection_score (bool, default: False ) –

    Weight first-pass geometry by detector confidence.

  • fuse_iou (bool, default: False ) –

    Fuse first-pass appearance costs with IoU before weighting.

  • delta_t (int, default: 3 ) –

    Observation lookback in frames for estimating motion direction.

  • inertia (float, default: 0.2 ) –

    Weight of the observed velocity-direction term in matching.

  • w_association_emb (float, default: 0.75 ) –

    Base weight of appearance similarity during matching.

  • alpha_fixed_emb (float, default: 0.95 ) –

    Previous-embedding weight for fully confident detections. Lower-confidence updates retain more of the previous embedding.

  • aw_param (float, default: 0.5 ) –

    Similarity-ratio cutoff for reducing ambiguous appearance weights.

  • use_embeddings (bool, default: True ) –

    Use supplied appearance embeddings, generating missing embeddings from image frames with the configured ReID backend.

  • aw_off (bool, default: False ) –

    Disable adaptive weighting of appearance similarity.

  • det_thresh (float, default: 0.5 ) –

    Minimum detection confidence for the shared tracking kernel.

Bases: BoxTracker

Track AABB or OBB detections with observation-centric motion and optional ReID.

Attributes:

  • cmc –

    Camera-motion compensation method.

Parameters:

  • config (DeepOcSortConfig | None, default: None ) –

    Immutable algorithm settings. None selects DeepOcSortConfig defaults.

  • kalman (KalmanConfig | None, default: None ) –

    Immutable filter noise, timing, and supported behavior settings. None preserves tracker defaults.

  • reid (ReIDConfig | AppearanceEncoder | None, default: None ) –

    Immutable encoder configuration or a canonical appearance encoder. Missing embeddings are generated lazily; None selects the default encoder.

  • **kwargs (Unpack[BoxTrackerOptions], default: {} ) –

    Runtime per_class, is_obb, class_ids, class_names, mask_guidance, and edgetam settings.

cmc_detection_boxes

cmc_detection_boxes(dets: ndarray) -> ndarray

Keep original high-score masking unless calibration fixes a threshold.