> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/workflows/blocks/blocks/video-processing/sort-tracker.md).

# SORT Tracker

Track objects across video frames using the **SORT** algorithm from the roboflow/trackers package.

SORT pairs a Kalman filter motion model with single-stage IoU-based Hungarian assignment. It has the fewest parameters and lowest overhead, processing hundreds of frames per second. However, it lacks re-identification and occlusion-recovery mechanisms, so tracks may fragment or switch IDs when objects are temporarily hidden.

**When to use SORT:**

* Controlled environments with reliable, high-confidence detections.
* Real-time pipelines where maximum throughput is critical.
* Simple scenes with minimal occlusion and predictable linear motion.

**When to consider alternatives:**

* If you see fragmented tracks or missed weak detections, try **ByteTrack**.
* If objects undergo heavy occlusion or non-linear motion, try **OC-SORT**.

Outputs three detection sets:

* **tracked\_detections**: All confirmed tracked detections with assigned track IDs.
* **new\_instances**: Detections whose track ID appears for the first time.
* **already\_seen\_instances**: Detections whose track ID has been seen in a prior frame.

The block maintains separate tracker state and instance cache per `video_identifier`, enabling multi-stream tracking within a single workflow.

### Type identifier

Use the following identifier in step `"type"` field: `roboflow_core/trackers_sort@v1` to add the block as a step in your workflow.

### Properties

| **Name**                     | **Type** | **Description**                                                                                                                                | Refs |
| ---------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
| `name`                       | `str`    | Enter a unique identifier for this step..                                                                                                      | ❌    |
| `minimum_iou_threshold`      | `float`  | Minimum IoU required to associate a detection with an existing track. Default: 0.3..                                                           | ✅    |
| `minimum_consecutive_frames` | `int`    | Number of consecutive frames a track must be matched before it is emitted as a confirmed track (tracker\_id != -1). Default: 3..               | ✅    |
| `lost_track_buffer`          | `int`    | Number of frames to keep a track alive after it loses its matched detection. Higher values improve occlusion recovery. Default: 30..           | ✅    |
| `track_activation_threshold` | `float`  | Minimum detection confidence required to spawn a new track. Detections below this threshold are not used to create new tracks. Default: 0.25.. | ✅    |
| `instances_cache_size`       | `int`    | Maximum number of track IDs retained in the instance cache for new/already-seen categorisation. Uses FIFO eviction. Default: 16384..           | ❌    |

The **Refs** column marks possibility to parametrise the property with dynamic values available in `workflow` runtime. See *Bindings* for more info.

### Runtime compatibility

`soft` - runtime `hosted_serverless`, `dedicated_deployment`; execution `remote`; input `video` : Block keeps per-video state in process memory (keyed by video\_metadata.video\_identifier). With remote step execution on stateless or multi-replica HTTP runtimes, successive requests may be served by different worker processes, so the state resets between calls and the output is meaningless for tracking / counting / aggregation. Use local step execution in a persistent WebRTC session for stable cross-frame results.

`soft` - input `image` : Block depends on temporal context from video or repeated-frame workflows. With a still image/photo, there is no meaningful history to track, compare, aggregate, or visualize, so the block provides little or no benefit.

### Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds `SORT Tracker` in version `v1` has.

<details>

<summary>Input and output bindings</summary>

* input
  * `image` ([*`image`*](/workflows/developer-guide/developer-guide/kinds/image.md)): Input image with embedded video metadata (fps and video\_identifier). Used to initialise and retrieve per-video tracker state..
  * `detections` (*Union\[*[*`rle_instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/rle-instance-segmentation-prediction.md)*,* [*`object_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/object-detection-prediction.md)*,* [*`instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/instance-segmentation-prediction.md)*,* [*`keypoint_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/keypoint-detection-prediction.md)*]*): Detection predictions for the current frame to track..
  * `minimum_iou_threshold` ([*`float_zero_to_one`*](/workflows/developer-guide/developer-guide/kinds/float-zero-to-one.md)): Minimum IoU required to associate a detection with an existing track. Default: 0.3..
  * `minimum_consecutive_frames` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Number of consecutive frames a track must be matched before it is emitted as a confirmed track (tracker\_id != -1). Default: 3..
  * `lost_track_buffer` ([*`integer`*](/workflows/developer-guide/developer-guide/kinds/integer.md)): Number of frames to keep a track alive after it loses its matched detection. Higher values improve occlusion recovery. Default: 30..
  * `track_activation_threshold` ([*`float_zero_to_one`*](/workflows/developer-guide/developer-guide/kinds/float-zero-to-one.md)): Minimum detection confidence required to spawn a new track. Detections below this threshold are not used to create new tracks. Default: 0.25..
* output
  * `tracked_detections` (*Union\[*[*`object_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/object-detection-prediction.md)*,* [*`instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/instance-segmentation-prediction.md)*,* [*`keypoint_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/keypoint-detection-prediction.md)*,* [*`rle_instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/rle-instance-segmentation-prediction.md)*]*): Prediction with detected bounding boxes in form of sv.Detections(...) object if `object_detection_prediction` or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object if `instance_segmentation_prediction` or Prediction with detected bounding boxes and detected keypoints in form of sv.Detections(...) object if `keypoint_detection_prediction` or Prediction with detected bounding boxes and RLE-encoded segmentation masks in form of sv.Detections(...) object if `rle_instance_segmentation_prediction`.
  * `new_instances` (*Union\[*[*`object_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/object-detection-prediction.md)*,* [*`instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/instance-segmentation-prediction.md)*,* [*`keypoint_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/keypoint-detection-prediction.md)*,* [*`rle_instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/rle-instance-segmentation-prediction.md)*]*): Prediction with detected bounding boxes in form of sv.Detections(...) object if `object_detection_prediction` or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object if `instance_segmentation_prediction` or Prediction with detected bounding boxes and detected keypoints in form of sv.Detections(...) object if `keypoint_detection_prediction` or Prediction with detected bounding boxes and RLE-encoded segmentation masks in form of sv.Detections(...) object if `rle_instance_segmentation_prediction`.
  * `already_seen_instances` (*Union\[*[*`object_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/object-detection-prediction.md)*,* [*`instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/instance-segmentation-prediction.md)*,* [*`keypoint_detection_prediction`*](/workflows/developer-guide/developer-guide/kinds/keypoint-detection-prediction.md)*,* [*`rle_instance_segmentation_prediction`*](/workflows/developer-guide/developer-guide/kinds/rle-instance-segmentation-prediction.md)*]*): Prediction with detected bounding boxes in form of sv.Detections(...) object if `object_detection_prediction` or Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object if `instance_segmentation_prediction` or Prediction with detected bounding boxes and detected keypoints in form of sv.Detections(...) object if `keypoint_detection_prediction` or Prediction with detected bounding boxes and RLE-encoded segmentation masks in form of sv.Detections(...) object if `rle_instance_segmentation_prediction`.

</details>

<details>

<summary>Example JSON definition</summary>

```json
{
	    "name": "<your_step_name_here>",
	    "type": "roboflow_core/trackers_sort@v1",
	    "image": "<block_does_not_provide_example>",
	    "detections": "$steps.object_detection_model.predictions",
	    "minimum_iou_threshold": 0.3,
	    "minimum_consecutive_frames": 3,
	    "lost_track_buffer": 30,
	    "track_activation_threshold": 0.25,
	    "instances_cache_size": "<block_does_not_provide_example>"
	}
```

</details>
