Trackers API
SORT
trackers.core.sort.tracker.SORTTracker
Bases: BaseTracker
In SORT, object tracking begins with high-confidence detections fed into a Kalman filter framework assuming uniform motion for state prediction across frames. Association occurs via IoU-based costs in the Hungarian algorithm, enforcing a threshold to filter weak matches and initialize new identities. Tracks persist only with consistent associations, terminating quickly to avoid erroneous propagation. This detection-driven approach underscores the importance of upstream detector performance in achieving competitive multi-object tracking results. Over time, SORT has become a cornerstone for evaluating motion-based improvements in the field.
SORT's standout strength is its real-time capability, processing hundreds of frames per second while maintaining accuracy comparable to more complex offline methods. It performs well in controlled environments with reliable detections, minimizing computational demands. However, without mechanisms for re-identification, it incurs frequent identity switches during object reappearances post-occlusion. The linear motion assumption limits effectiveness in non-linear paths, such as those in sports or wildlife tracking. Ultimately, SORT's efficiency is offset by its sensitivity to environmental complexities, necessitating hybrid extensions for broader applicability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lost_track_buffer
|
int
|
Non-negative |
30
|
frame_rate
|
float
|
|
30.0
|
track_activation_threshold
|
float
|
|
0.25
|
minimum_consecutive_frames
|
int
|
|
3
|
minimum_iou_threshold
|
float
|
|
0.3
|
state_estimator_class
|
type[BaseStateEstimator]
|
State estimator class to use for Kalman filter.
|
XYXYStateEstimator
|
iou
|
BaseIoU | None
|
IoU similarity metric instance to use for data association.
Defaults to standard |
None
|
trackers
property
Deprecated alias for :attr:tracks.
.. deprecated:: 2.5
Use :attr:tracks instead. Will be removed in v3.0.
update(detections, frame=None, timestamp=None)
Update tracker state with new detections and return tracked objects. Performs Kalman filter prediction, IoU-based association, and initializes new tracks for unmatched high-confidence detections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
Detections
|
|
required |
frame
|
ndarray | None
|
Ignored by SORT. If provided (not |
None
|
timestamp
|
float | None
|
Absolute time of the current frame in seconds, or |
None
|
Returns:
| Type | Description |
|---|---|
Detections
|
sv.Detections with tracker_id assigned for each detection. |
Detections
|
Unmatched or immature tracks have tracker_id of -1. |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
reset()
Reset tracker state by clearing all tracks and resetting ID counter.
Call this method when switching to a new video or scene.
ByteTrack
trackers.core.bytetrack.tracker.ByteTrackTracker
Bases: BaseTracker
ByteTrack operates online by processing all detector outputs, categorizing them by confidence thresholds to enable a two-stage association process. High-score boxes are initially linked to tracklets via Kalman filter predictions and IoU-based Hungarian matching, optionally enhanced with appearance features. Low-score boxes follow in a secondary matching phase using pure motion similarity to revive occluded tracks. Tracks without matches are kept briefly for potential re-association, preventing premature termination. This inclusive approach addresses common pitfalls in detection filtering, establishing ByteTrack as a flexible enhancer for existing tracking frameworks.
ByteTrack excels in dense environments, where its low-score recovery mechanism minimizes missed detections and enhances overall trajectory completeness. It consistently improves performance across diverse datasets, demonstrating robustness and generalization. The tracker's speed remains competitive, facilitating integration into production pipelines. On the downside, it is highly dependent on detector quality, with performance drops in noisy or low-resolution inputs. Additionally, the motion-only secondary association may lead to erroneous matches in scenes with similar moving objects.
Note
When input detections carry no confidence (detections.confidence is
None), ByteTrack falls back to a single-stage IoU match equivalent to
SORT — every detection is treated as fully confident, so the
low-confidence recovery stage is bypassed. Pass per-detection
confidences to exercise the two-stage matching this class otherwise
provides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lost_track_buffer
|
int
|
Non-negative |
30
|
frame_rate
|
float
|
|
30.0
|
track_activation_threshold
|
float
|
|
0.7
|
minimum_consecutive_frames
|
int
|
|
2
|
minimum_iou_threshold
|
float
|
|
0.1
|
high_conf_det_threshold
|
float
|
|
0.6
|
state_estimator_class
|
type[BaseStateEstimator]
|
State estimator class to use for Kalman filter.
Defaults to |
XYXYStateEstimator
|
iou
|
BaseIoU | None
|
IoU similarity metric instance to use for data association.
Defaults to standard |
None
|
update(detections, frame=None, timestamp=None)
Update tracks state with new detections and return tracked objects. Performs Kalman filter prediction, two-stage association (high then low confidence), and initializes new tracks for unmatched detections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
Detections
|
|
required |
frame
|
ndarray | None
|
Ignored by ByteTrack. If provided (not |
None
|
timestamp
|
float | None
|
Absolute time of the current frame in seconds, or |
None
|
Returns:
| Type | Description |
|---|---|
Detections
|
sv.Detections with tracker_id assigned for each detection. |
Detections
|
Unmatched detections have tracker_id of -1. Detection order may |
Detections
|
differ from input. |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
reset()
Reset tracker state by clearing all tracks and resetting ID counter.
Call this method when switching to a new video or scene.
OC-SORT
trackers.core.ocsort.tracker.OCSORTTracker
Bases: BaseTracker
OC-SORT enhances traditional SORT by shifting to an observation-centric paradigm, using detections to correct Kalman filter errors accumulated during occlusions. It introduces Observation-Centric Re-Update to generate virtual trajectories for parameter refinement upon track reactivation. Association incorporates Observation-Centric Momentum, blending IoU with direction consistency from historical observations. Short-term recoveries are aided by heuristics linking unmatched tracks to prior detections. This rethinking prioritizes real measurements over estimations, making OC-SORT particularly adept at handling real-world tracking challenges.
OC-SORT's primary strength is its robustness to non-linear motions and occlusions, outperforming baselines on datasets with erratic movements like DanceTrack. It maintains extreme efficiency, processing over 700 frames per second on CPUs for scalable deployments. The tracker excels in crowded scenes, reducing identity switches through momentum-based associations. However, lacking appearance features, it can confuse similar objects in overlapping paths. Its linear motion core still imposes limits in extreme velocity variations, requiring careful parameter selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lost_track_buffer
|
int
|
Non-negative |
30
|
frame_rate
|
float
|
|
30.0
|
minimum_consecutive_frames
|
int
|
|
3
|
minimum_iou_threshold
|
float
|
|
0.3
|
direction_consistency_weight
|
float
|
|
0.2
|
high_conf_det_threshold
|
float
|
|
0.6
|
delta_t
|
int
|
|
3
|
state_estimator_class
|
type[BaseStateEstimator]
|
State estimator class to use for Kalman filter.
Defaults to |
XCYCSRStateEstimator
|
iou
|
BaseIoU | None
|
IoU similarity metric instance to use for data association.
Defaults to standard |
None
|
update(detections, frame=None, timestamp=None)
Update tracker state with new detections and return tracked objects. Performs Kalman filter prediction, two-stage association using direction consistency and last-observation recovery, and initializes new tracks for unmatched high-confidence detections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
Detections
|
|
required |
frame
|
ndarray | None
|
Ignored by OC-SORT. If provided (not |
None
|
timestamp
|
float | None
|
Absolute time of the current frame in seconds, or |
None
|
Returns:
| Type | Description |
|---|---|
Detections
|
sv.Detections with tracker_id assigned for each detection. |
Detections
|
Unmatched or immature tracks, and detections below |
Detections
|
|
Detections
|
spawn a track), have tracker_id of -1. Detection order may differ |
Detections
|
from input. |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
reset()
Reset tracker state by clearing all tracks and resetting ID counter.
Call this method when switching to a new video or scene.
BoT-SORT
trackers.core.botsort.tracker.BoTSORTTracker
Bases: BaseTracker
BoT-SORT-style multi-object tracker (IoU association + optional CMC).
The tracker maintains a list of active tracks (Kalman-filter-based) and, for each frame, performs: 1) Predict existing track states (Kalman predict) 2) Split detections into high/low confidence groups 3) Split tracks into confirmed, unconfirmed, and lost 4) Apply camera motion compensation to predicted tracks 5) Associate high-confidence detections to confirmed + lost tracks (IoU fused with detection scores + assignment) 6) Associate low-confidence detections to remaining tracks (excluding lost tracks) 7) Match remaining unmatched high-confidence detections to unconfirmed tracks and remove unmatched unconfirmed tracks 8) Spawn new tracks from still unmatched high-confidence detections (instantly activated on the very first frame) 9) Remove tracks that have been lost for too long
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lost_track_buffer
|
int
|
Non-negative time buffer (in frames at 30 FPS) for
keeping lost tracks alive before deletion. |
30
|
frame_rate
|
float
|
Video frame rate used to scale the lost track buffer to time-like behavior. Must be positive. |
30.0
|
track_activation_threshold
|
float
|
Minimum detection confidence to spawn a new track. |
0.7
|
minimum_consecutive_frames
|
int
|
Number of successful updates required before assigning a stable track ID (different than initial -1). |
2
|
minimum_iou_threshold_first_assoc
|
float
|
Minimum fused similarity (IoU x detection confidence) to accept a detection-track association during the first association step. |
0.2
|
minimum_iou_threshold_second_assoc
|
float
|
Minimum IoU to accept a detection-track association during the second association step. No score fusion is applied in this pass, so this is plain IoU. |
0.5
|
minimum_iou_threshold_unconfirmed_assoc
|
float
|
Minimum fused similarity (IoU x score) to accept a match between an unconfirmed track and a remaining high-confidence detection. Corresponds to the original ByteTrack's hardcoded cost threshold of 0.7 (= similarity 0.3). |
0.3
|
high_conf_det_threshold
|
float
|
Confidence threshold used to split detections into: - high confidence: confidence >= threshold - low confidence: confidence < threshold |
0.6
|
enable_cmc
|
bool
|
Whether to enable camera motion compensation (CMC). |
True
|
cmc_method
|
CMCMethod
|
CMC method string passed into |
'sparseOptFlow'
|
cmc_downscale
|
int
|
Downscale factor used inside CMC for speed/robustness. |
2
|
instant_first_frame_activation
|
bool
|
If |
True
|
state_estimator_class
|
type[BaseStateEstimator]
|
State estimator class for tracklets. Defaults
to |
XCYCWHStateEstimator
|
iou
|
BaseIoU | None
|
IoU similarity metric instance to use for data association.
Defaults to standard |
None
|
Notes
- Positive
maximum_frames_without_updatevalues are scaled byframe_rateand rounded up to at least one missed frame. Explicit zero-buffer configurations remain zero. - When CMC is enabled, pass the current video frame via the
frameargument of :meth:update.
update(detections, frame=None, timestamp=None)
Update the tracker with detections from the current frame.
This is the main per-frame entry point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
Detections
|
Supervision detections for the current frame. Must include
|
required |
frame
|
ndarray | None
|
Current video frame in BGR format (H, W, 3), or |
None
|
timestamp
|
float | None
|
Absolute time of the current frame in seconds, or |
None
|
Returns:
| Type | Description |
|---|---|
Detections
|
New sv.Detections with tracker_id assigned for each detection. |
Detections
|
Confirmed tracks have tracker_id >= 0; unconfirmed tracks have |
Detections
|
tracker_id of -1. |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
Notes
- If CMC is enabled, pass the current video frame via
frameso the tracker can estimate a global affine transform and warp predicted track states before association. Whenframe=Noneandenable_cmc=True, CMC is silently skipped for that step.
reset()
Reset tracker state by clearing all tracks and resetting ID counter.
Call this method when switching to a new video or scene.
apply_cmc_batch(H)
Apply CMC to all active tracks.
.. deprecated:: 2.5 Use CMC.apply_batch(H, self.tracks) directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
H
|
ndarray | None
|
2x3 affine transform matrix returned by CMC.estimate(). If None, this method is a no-op. |
required |
Examples:
C-BIoU
trackers.core.cbiou.tracker.CBIoUTracker
Bases: BoTSORTTracker
Cascaded-Buffered IoU (C-BIoU) tracker.
Implements the matching strategy from Yang et al., Hard To Track Objects with Irregular Motions and Similar Appearances? Make It Easier by Buffering the Matching Space, WACV 2023 (paper).
The paper proposes Buffered IoU (BIoU) — expanding boxes by a proportional
margin before computing overlap — and cascaded matching with a small buffer
scale b1 followed by a larger scale b2 (typically b1 < b2).
Each association step uses its own buffer_ratio:
buffer_ratio_first— first pass (high-confidence detections vs tracks; paper: smallb1).buffer_ratio_second— second pass (remaining confirmed tracks vs low-confidence detections; paper: largeb2).
The ByteTrack-style unconfirmed-track step (leftover high-confidence
detections vs tentative tracks) reuses b1 (iou_first).
Camera motion compensation is not used (detection-only / MOT-file workflows).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lost_track_buffer
|
int
|
Time buffer (in frames at 30 FPS) for keeping lost
tracks alive before deletion. Scaled by |
30
|
frame_rate
|
float
|
Video frame rate used to scale the lost track buffer. |
30.0
|
track_activation_threshold
|
float
|
Minimum detection confidence to spawn a new track. |
0.7
|
minimum_consecutive_frames
|
int
|
Number of successful updates required before assigning a stable track ID. |
2
|
minimum_iou_threshold_first_assoc
|
float
|
Minimum fused similarity for the first association step. |
0.2
|
minimum_iou_threshold_second_assoc
|
float
|
Minimum fused similarity for the second association step. |
0.5
|
minimum_iou_threshold_unconfirmed_assoc
|
float
|
Minimum fused similarity for the unconfirmed association step. |
0.3
|
high_conf_det_threshold
|
float
|
Confidence threshold splitting high / low detections. |
0.6
|
instant_first_frame_activation
|
bool
|
If |
True
|
state_estimator_class
|
type[BaseStateEstimator]
|
Kalman state representation for tracklets. |
XCYCWHStateEstimator
|
buffer_ratio_first
|
float
|
Buffer scale |
0.3
|
buffer_ratio_second
|
float
|
Buffer scale |
0.5
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ValueError
|
If |
Note
Unmatched low-confidence detections (confidence in (0.1, high_conf_det_threshold))
that are not associated in Step 2 appear in the output with tracker_id == -1,
consistent with BoTSORTTracker behaviour. Callers filtering by
tracker_id >= 0 will silently drop these rows.
Tracks that already hold a real tracker_id (for example, instant-activated
tracks) remain confirmed on a miss even before minimum_consecutive_frames is
reached.
Example
Run C-BIoU on a batch of detections::
import numpy as np
import supervision as sv
from trackers import CBIoUTracker
tracker = CBIoUTracker()
detections = sv.Detections(
xyxy=np.array([[0.0, 0.0, 100.0, 100.0]]),
confidence=np.array([0.9]),
)
result = tracker.update(detections)
update(detections, frame=None, timestamp=None)
Update the C-BIoU tracker with detections from the current frame.
Runs the association pipeline with a distinct BIoU instance per step (cascaded buffers per Yang et al., WACV 2023). Does not use frames or CMC.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
Detections
|
Supervision detections for the current frame. |
required |
frame
|
ndarray | None
|
Unused. Emits a |
None
|
timestamp
|
float | None
|
Absolute time of the current frame in seconds, or |
None
|
Returns:
| Type | Description |
|---|---|
Detections
|
Detections with |
Detections
|
low-confidence detections are included with |
Detections
|
callers filtering by |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
McByte
trackers.core.mcbyte.tracker.McByteTracker
Bases: BaseTracker
McByte multi-object tracker with optional mask-conditioned association.
McByte extends a ByteTrack-style multi-stage tracking pipeline with clear-match locking, reduced assignment, optional camera motion compensation, and optional propagated-mask evidence.
The tracker can operate in two configurations:
- without a
MaskManager, association uses the McByte clear-match locking and reduced-assignment procedure with IoU-based similarities; - with a
MaskManager(full McByte), masks are additionally used to condition ambiguous associations and, when enabled, isolated positive-IoU associations below the normal stage threshold.
When enable_mask_manager=True, the default mask pipeline initializes
masks from detection boxes using SAM and propagates them temporally using
Cutie. A custom MaskManager may instead be supplied directly, for
example to inject alternative mask components or lightweight test doubles.
Mask processing follows the original McByte timing. At frame t, masks
are updated before association using the frame, visible tracklets, newly
created tracklets, and removed-tracklet events stored after processing frame
t - 1. Temporarily lost but still active tracklets retain their masks.
Masks are removed only after the corresponding tracklets are terminated
during tracker pruning.
Input frames are expected in RGB channel order. A frame is required when mask management is enabled and is also needed for camera motion compensation. When no frame is supplied, those frame-dependent operations are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lost_track_buffer
|
int
|
Time buffer, expressed as a number of frames at
30 FPS, for retaining unmatched tracks before deletion. The value
is scaled according to |
30
|
frame_rate
|
float
|
Sequence frame rate used to scale |
30.0
|
track_activation_threshold
|
float
|
Minimum detection confidence required to create a new tracklet. |
0.7
|
minimum_consecutive_frames
|
int
|
Number of successful tracklet updates required before assigning a confirmed non-negative tracker ID. |
2
|
minimum_iou_threshold_first_assoc
|
float
|
Minimum association similarity for
matching high-confidence detections to confirmed and lost tracks.
The default of |
0.1
|
minimum_iou_threshold_second_assoc
|
float
|
Minimum association similarity for matching low-confidence detections to remaining tracked tracks. |
0.5
|
minimum_iou_threshold_unconfirmed_assoc
|
float
|
Minimum association similarity for matching unconfirmed tracks to remaining high-confidence detections. |
0.3
|
high_conf_det_threshold
|
float
|
Confidence threshold separating high- and low-confidence detections. Detections with confidence at or below 0.1 are discarded. |
0.6
|
enable_cmc
|
bool
|
Whether to apply camera motion compensation before association. |
True
|
cmc_method
|
CMCMethod
|
Camera motion compensation method. |
'sparseOptFlow'
|
cmc_downscale
|
int
|
Image downscale factor used during camera motion estimation. Defaults to 6 based on the 1280x720 SportsMOT validation aggregate-performance criterion; it is not a strict per-clip guarantee. Tune it for other workloads or pass 2 to preserve the previous conservative behavior. |
6
|
instant_first_frame_activation
|
bool
|
Whether tracklets created on the first frame receive confirmed tracker IDs immediately. |
True
|
state_estimator_class
|
type[BaseStateEstimator]
|
State estimator class used by newly created
|
XCYCWHStateEstimator
|
iou
|
BaseIoU | None
|
IoU implementation used to compute association similarities. When
omitted, the default |
None
|
enable_mask_manager
|
bool
|
Whether to construct McByte's default SAM and Cutie mask pipeline. It is disabled by default to avoid loading optional heavyweight models when mask-conditioned tracking is not requested. |
False
|
mask_manager
|
MaskManager | None
|
Optional custom |
None
|
mask_config
|
McByteMaskConfig | None
|
Configuration for automatic construction of the default
SAM/Cutie pipeline. It requires |
None
|
minimum_mask_average_confidence
|
float
|
Minimum average confidence of a propagated mask before it may influence association. |
MINIMUM_MASK_AVERAGE_CONFIDENCE
|
minimum_mask_coverage
|
float
|
Minimum fraction of the visible tracklet mask that must lie inside a candidate detection box. |
MINIMUM_MASK_COVERAGE
|
minimum_mask_fill_ratio
|
float
|
Minimum fraction of a candidate detection-box area that must be occupied by the tracklet mask. |
MINIMUM_MASK_FILL_RATIO
|
enable_isolated_mask_matching
|
bool
|
Whether mask evidence may rescue an isolated candidate with positive IoU whose association similarity is below the normal stage threshold. |
False
|
minimum_mask_creation_frames
|
int
|
Number of consecutive frames a confirmed
tracklet must remain visible in tracker output before its mask is
created (the SAM prompt plus Cutie |
3
|
update(detections, frame=None, timestamp=None)
Update the tracker with detections from the current frame.
This is the main per-frame entry point. If a mask manager is configured and a frame is provided, masks are updated before association using tracker lifecycle events stored from the previous call. After association, the method stores the current frame's visible tracklets, newly created tracklets, and explicitly terminated tracklet IDs for the next frame's mask update.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
Detections
|
Supervision detections for the current frame. Must include
|
required |
frame
|
ndarray | None
|
Current frame in RGB channel order, shape |
None
|
timestamp
|
float | None
|
Absolute time of the current frame in seconds, or |
None
|
Returns:
| Type | Description |
|---|---|
Detections
|
New sv.Detections with tracker_id assigned for each output detection. |
Detections
|
Confirmed tracks have tracker_id >= 0; unmatched/unconfirmed detections have |
Detections
|
tracker_id of -1. When the update is skipped (backwards or non-finite |
Detections
|
timestamp), all |
Warns:
| Type | Description |
|---|---|
UserWarning
|
If |
reset()
Reset tracker, camera-motion, and mask-manager state.
This clears active tracklets, resets the global McByte track ID counter, clears stored mask lifecycle inputs, and resets optional camera motion compensation and mask-manager components. Call this when switching to a new video or scene.
apply_cmc_batch(H)
Apply camera motion compensation to all active tracks.
Convenience wrapper around :meth:CMC.apply_batch for callers that hold
a tracker instance and an affine transform. update() applies CMC
directly and does not rely on this method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
H
|
ndarray | None
|
2x3 affine transform matrix returned by CMC.estimate(). If None, this method is a no-op. |
required |
Examples:
trackers.core.mcbyte.tracker.McByteMaskConfig
dataclass
Configuration for McByte's SAM and Cutie mask pipeline.
The configuration is used only when McByteTracker automatically creates
its default real MaskManager. It is ignored when a custom manager is
supplied directly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
str
|
Device shared by SAM and Cutie, for example |
'auto'
|
sam_checkpoint_path
|
str | Path | None
|
Optional SAM checkpoint path. When omitted, the
default checkpoint for |
None
|
sam_model_type
|
str
|
SAM model variant used for box-prompted mask generation. |
'vit_b'
|
cutie_weights_path
|
str | Path | None
|
Optional Cutie checkpoint path. When omitted, the
default checkpoint for |
None
|
cutie_model_type
|
str
|
Cutie model variant used for temporal propagation. |
'base-mega'
|
cutie_config_path
|
str | Path | None
|
Optional Cutie Hydra configuration directory. When omitted, it is inferred from the installed Cutie package. |
None
|
cutie_config_name
|
str
|
Hydra configuration name loaded by Cutie. |
'eval_config'
|
cutie_use_amp
|
bool
|
Whether Cutie may use automatic mixed precision. AMP is activated only when Cutie runs on a CUDA device. Disabled by default so that default runs use full fp32 precision on every backend; opt in explicitly after validating tracking-quality parity on your hardware. |
False
|
cutie_max_internal_size
|
int
|
Maximum shortest side of frames processed
internally by Cutie. Larger frames are downscaled before the
encoder and the propagated masks are restored to the original
resolution, matching Cutie's own streaming preset. Use |
480
|
cutie_mem_every
|
int | None
|
How often, in frames, Cutie updates its working
memory. Higher values speed up processing. |
10
|
cutie_use_long_term
|
bool | None
|
Whether Cutie uses bounded long-term memory,
recommended for videos longer than roughly one minute. |
True
|
cutie_channels_last
|
bool
|
Opt-in |
False
|
cutie_compile
|
bool
|
Opt-in |
False
|
mask_creation_bbox_overlap_threshold
|
float
|
Bounding-box overlap fraction at
or above which mask creation is delayed by |
MASK_CREATION_BBOX_OVERLAP_THRESHOLD
|
Utilities
trackers.utils.converters.xyxy_to_xcycsr(xyxy)
Convert bounding boxes from corner to center-scale-ratio format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xyxy
|
ndarray
|
Bounding boxes |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Bounding boxes |
Examples:
trackers.utils.converters.xcycsr_to_xyxy(xcycsr)
Convert bounding boxes from center-scale-ratio to corner format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xcycsr
|
ndarray
|
Bounding boxes |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Bounding boxes |
ndarray
|
Decoding is always performed in floating point: integer input is promoted |
ndarray
|
( |
ndarray
|
precision ( |
Note
When scale or aspect_ratio is zero, w collapses to 0.0
and the box degenerates to a point at (x_center, y_center) — all four
coordinates equal the center. No NaN or Inf is produced.
When the product scale * aspect_ratio underflows to exactly 0.0
due to subnormal float arithmetic (e.g. both values near 1e-200), the
zero-guard fires and returns h=0.0 even though the mathematically
correct value may be non-zero.
Negative scale yields NaN entries because sqrt of a negative
value is undefined.
Examples:
>>> import numpy as np
>>> from trackers import xcycsr_to_xyxy
>>>
>>> boxes = np.array([
... [ 5., 5., 100., 1.],
... [ 10., 5., 200., 2.],
... [ 5., 10., 200., 0.5],
... ])
>>>
>>> xcycsr_to_xyxy(boxes)
array([[ 0., 0., 10., 10.],
[ 0., 0., 20., 10.],
[ 0., 0., 10., 20.]])
>>>
>>> # degenerate: zero scale collapses to a point box
>>> xcycsr_to_xyxy(np.array([10., 20., 0., 1.]))
array([10., 20., 10., 20.])