Skip to main content

Templates for multi-object tracking using the ByteTrack algorithm

Project description



Sinapsis Supervision

Templates for multi-object tracking using the ByteTrack model

🐍 Installation 🚀 Features📙 Documentation 🔍 License

The sinapsis-supervision module offers a powerful and flexible implementation for multi-object tracking using the ByteTrack algorithm. It allows users to easily configure and run tracking pipelines for video input processing, object detection, and tracking tasks.

🐍 Installation

Install using your package manager of choice. We encourage the use of uv

Example with uv:

  uv pip install sinapsis-supervision --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-supervision --extra-index-url https://pypi.sinapsis.tech

🚀 Features

Templates Supported

The Sinapsis ByteTrack module provides a template for multi-object tracking using the ByteTrack algorithm. Currently, the package includes the following template:

  • ByteTrack: A template for tracking objects across video frames, with customizable parameters for track activation, matching thresholds, and occlusion handling.

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis Supervision.

[!TIP] Use CLI command sinapsis info --example-template-config TEMPLATE_NAME to produce an example Agent config for the Template specified in TEMPLATE_NAME.

For example, for ByteTrack use sinapsis info --example-template-config ByteTrack to produce the following example config:

agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: ByteTrack
  class_name: ByteTrack
  template_input: InputTemplate
  attributes:
    track_activation_threshold: 0.2
    lost_track_buffer: 30
    minimum_matching_threshold: 0.7
    frame_rate: 30
    minimum_consecutive_frames: 1
📚 Example Usage

Below is an example YAML configuration for processing a video file and visualizing tracking results using the Sinapsis Supervision template. This configuration loads a video with the VideoReaderCV2, performs object detection and real-time tracking with the UltralyticsPredict and ByteTrack templates, draws bounding boxes around detected objects with the BBoxDrawer, and saves the output as a new video file using the VideoWriterCV2.

Config
agent:
  name: cotracker_agent

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name : VideoReaderCV2
    class_name: VideoReaderCV2
    template_input: InputTemplate
    attributes:
      video_file_path : "artifacts/palace.mp4"
      batch_size: 16

  - template_name: CoTrackerOnline
    class_name: CoTrackerOnline
    template_input: VideoReaderCV2
    attributes:
      model_variant: baseline
      device: cuda
      grid_size: 15

  - template_name: CoTrackerVisualizer
    class_name: CoTrackerVisualizer
    template_input: CoTrackerOnline
    attributes:
      device : cuda
      linewidth: 3
      overwrite: true

  - template_name: VideoWriterCV2
    class_name: VideoWriterCV2
    template_input: CoTrackerVisualizer
    attributes:
      destination_path: "artifacts/result.mp4"
      height: -1
      width: -1
      fps: 30

This configuration defines an agent and a sequence of templates for video processing, object detection, real-time tracking, and visualization.

IMPORTANT: The VideoReaderCV2, BBoxDrawer, and VideoWriterCV2 templates are part of the sinapsis-data-readers, sinapsis-data-visualization, and sinapsis-data-writers packages, respectively. To use this example, ensure that you have installed these packages.

To run the config, use the CLI:

sinapsis run name_of_config.yml

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_supervision-0.1.4.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_supervision-0.1.4-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_supervision-0.1.4.tar.gz.

File metadata

File hashes

Hashes for sinapsis_supervision-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a4b8749f906b81c995e4502b438a15e514d9a99c2b87e8895acde3d2b729e75c
MD5 970bfd2f247a248a7b680f2b9cb628c9
BLAKE2b-256 2383e255dfc16e69e71ba5206dd05b3f670e1afebf1f886c01dc87accae785ee

See more details on using hashes here.

File details

Details for the file sinapsis_supervision-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_supervision-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2d673a0071d452600b543b566435dec4c2e52c4c89c64ba678d36ca0197027ba
MD5 3c1b0641f0c1942336da54386ed8222e
BLAKE2b-256 a1b6000f20e7619f1d9069a5c8666c3e0ad4cf202e8a7e296aba4c742b6f4e16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page