Skip to content

boxmot.trackers.ocsort.config

Canonical algorithm settings for OcSort.

OcSortConfig dataclass

OcSortConfig(
    *,
    max_age: int = 30,
    max_obs: int = 50,
    min_hits: int = 3,
    iou_threshold: float = 0.3,
    asso_func: str = "iou",
    centroid_max_distance: float = 0.05,
    min_conf: float = 0.1,
    delta_t: int = 3,
    inertia: float = 0.1,
    use_byte: bool = False,
    det_thresh: float = 0.6,
    motion_fusion: str = "off",
    motion_fusion_lambda: float = 0.98,
    motion_fusion_only_position: bool = False,
    fuse_detection_score: bool = False,
    use_cmc: bool = False,
    cmc_method: str = "sof",
    cmc_min_conf: float | None = None,
)

Bases: TrackerConfig

Configure observation history and optional low-confidence recovery.

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.

  • min_conf (float, default: 0.1 ) –

    Minimum confidence for the low-score association pass when use_byte is enabled.

  • delta_t (int, default: 3 ) –

    Observation lookback in frames for estimating motion direction.

  • inertia (float, default: 0.1 ) –

    Weight of the observed velocity-direction term in matching.

  • use_byte (bool, default: False ) –

    Enable a second association pass for detections between min_conf and the shared detection threshold.

  • det_thresh (float, default: 0.6 ) –

    Minimum detection confidence for the shared tracking kernel.

cmc_method class-attribute instance-attribute

cmc_method: str = field(
    default="sof",
    metadata={"choices": ("ecc", "orb", "sof", "sift")},
)

cmc_min_conf class-attribute instance-attribute

cmc_min_conf: float | None = field(
    default=None, metadata={"ge": 0.0, "le": 1.0}
)

delta_t class-attribute instance-attribute

delta_t: int = field(default=3, metadata={'gt': 0})

det_thresh class-attribute instance-attribute

det_thresh: float = field(
    default=0.6, metadata={"ge": 0.0, "le": 1.0}
)

fuse_detection_score class-attribute instance-attribute

fuse_detection_score: bool = False

inertia class-attribute instance-attribute

inertia: float = field(default=0.1, metadata={'ge': 0})

min_conf class-attribute instance-attribute

min_conf: float = field(
    default=0.1, metadata={"ge": 0.0, "le": 1.0}
)

motion_fusion class-attribute instance-attribute

motion_fusion: str = field(
    default="off",
    metadata={"choices": ("off", "gate", "blend")},
)

motion_fusion_lambda class-attribute instance-attribute

motion_fusion_lambda: float = field(
    default=0.98, metadata={"ge": 0.0, "le": 1.0}
)

motion_fusion_only_position class-attribute instance-attribute

motion_fusion_only_position: bool = False

use_byte class-attribute instance-attribute

use_byte: bool = False

use_cmc class-attribute instance-attribute

use_cmc: bool = False