Templates for multi-object tracking using the CoTracker model, supporting offline, online, and visualization workflows.
Project description
Sinapsis CoTracker
Templates for multi-object tracking and visualization using the CoTracker model
🐍 Installation • 🚀 Features • 📙 Documentation • 🔍 License
The siinapsis-cotracker module provides a robust and flexible implementation for multi-object tracking using the CoTracker model. It enables users to easily configure and run tracking pipelines for video input processing and visualization tasks.
🐍 Installation
Install using your package manager of choice. We encourage the use of uv
[!WARNING]
cotrackerdependency is required to installsinapsis-cotracker
UV instructions
Install cotracker in your working environment as follows:
uv pip install git+https://github.com/facebookresearch/co-tracker.git
then install sinapsis-cotracker
uv pip install sinapsis-cotracker --extra-index-url https://pypi.sinapsis.tech
Raw pip instructions
Install cotracker in your working environment as follows:
pip install git+https://github.com/facebookresearch/co-tracker.git
then install sinapsis-cotracker
pip install sinapsis-cotracker --extra-index-url https://pypi.sinapsis.tech
🚀 Features
Templates Supported
The Sinapsis CoTracker module offers a set of templates for multi-object tracking and visualization using the CoTracker model. These templates enable users to perform both online and offline tracking, process video inputs, and visualize tracking results on video frames. The templates in this package include functionality for:
- CoTrackerOffline: Handles offline multi-object tracking for short videos. It loads the entire video into memory for processing and is the simplest method for offline tasks.
- CoTrackerOfflineLarge: Provides offline tracking for long videos by using a memory-efficient, incremental engine.
- CoTrackerOnline: Supports real-time object tracking with advanced grid query and support grid features.
- CoTrackerVisualizer: Visualizes tracking results with customizable trace, line width, and visualization modes.
[!TIP] Use CLI command
sinapsis info --all-template-namesto show a list with all the available Template names installed with Sinapsis CoTracker.
[!TIP] Use CLI command
sinapsis info --example-template-config TEMPLATE_NAMEto produce an example Agent config for the Template specified in TEMPLATE_NAME.
For example, for CoTrackerOffline use sinapsis info --example-template-config CoTrackerOffline to produce the following example config:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: CoTrackerOffline
class_name: CoTrackerOffline
template_input: InputTemplate
attributes:
device: '`replace_me:typing.Literal[''cuda'', ''cpu'']`'
generic_key_field: CoTrackerResults
model_cache_dir: /home/cv/.cache/sinapsis
model_variant: '`replace_me:typing.Literal[''baseline'', ''scaled'']`'
use_segmentation_mask: false
grid_size: '`replace_me:<class ''int''>`'
grid_query_frame: 0
backward_tracking: false
📚 Example Usage
Below is an example YAML configuration for processing a video file and visualizing tracking results using Sinapsis CoTracker templates. This setup loads a video with the VideoReaderCV2, performs real-time object tracking with the CoTrackerOnline template, visualizes the results with the CoTrackerVisualizer, 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 tracking, and visualization.
IMPORTANT: The VideoReaderCV2 and VideoWriterCV2 templates are part of the sinapsis-data-readers 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sinapsis_cotracker-0.1.6.tar.gz.
File metadata
- Download URL: sinapsis_cotracker-0.1.6.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2eb2a20dc4ed4d89ed6a8a323e004ceb9ed2fde6462e90157c944a76f8ca83df
|
|
| MD5 |
017c6768ce788ceb90046cc8d54962d3
|
|
| BLAKE2b-256 |
b12e1b75a00aa4e8d680c6ad1f991df40edc45089416f1557e7e62e62846588d
|
File details
Details for the file sinapsis_cotracker-0.1.6-py3-none-any.whl.
File metadata
- Download URL: sinapsis_cotracker-0.1.6-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8ddafd216c15a75c88e3b34fd67c8a521c5ac503b9d95442815f70e2f4501c5
|
|
| MD5 |
95d23d1a8288c45dfec11529503abc46
|
|
| BLAKE2b-256 |
c675115c07020d4bda6ffe298bb358228c0edb24c4f6681a584fa773fe38ec4b
|