Skip to content

DeepOcSort

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

Deep OC-SORT starts from OC-SORT's motion-centric association and adds appearance in a more adaptive way than earlier ReID heuristics. The paper argues that appearance should not dominate all the time, but should be integrated when it is actually helpful, especially under long occlusions and dense interactions. This makes it a stronger tracker than pure OC-SORT when motion cues alone are not enough to keep identities stable.

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. The canonical setting is use_cmc; replace an earlier cmc_off setting with its inverted boolean value. For example, cmc_off: true becomes use_cmc: false.

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.