Skip to main content

Real-time low-cost animal tracking and response delivery.

Project description

TracktorLive (v0.9-beta)

TracktorLive is a real-time video tracking and data serving framework designed for lightweight, scriptable tracking of individual animals in behavioral experiments. It provides programmatic hooks for processing and responding to tracked data on-the-fly, with no interaction needed with actual computer vision code.

The video tracking used in this project emerges from Tracktor::

Sridhar, V. H., Roche, D. G., & Gingins, S. (2019). Tracktor: Image-based automated tracking of animal movement and behaviour. Methods in Ecology and Evolution, 10(6), 815–820. DOI:10.1111/2041-210X.13166"

TracktorLive builds on that work, enabling real-time tracking and response delivery.


✨ Features

  • Real-time tracking of 1 or more individuals from real-time camera feed or pre-recorded video sources
  • Buffered data sharing via shared memory (suitable for high-speed use)
  • Modular "cassette" system for on-the-fly processing
  • Built-in support for:
    • Data streaming to external clients
    • Live or on-demand video and data recording
  • A number of useful tutorial scripts and a growing library of cassettes, through which even novice users can quickly create and run scripts.
  • Minimal external dependencies (NumPy, OpenCV, Scikit-Learn etc.)

🧠 Concept

TracktorLive works on a server--client model, where:

  • A server processes a video stream and maintains a shared data buffer with clock and tracked locations.
  • One or more clients can connect and access this data in real time.
  • Small, user-defined functions ("cassettes") can be registered to run every frame or at server shutdown.
  • This way, all tracking and multiprocessing happens in the background allowing users without computer vision experience to directly get involved with such experimental setups.

All interaction is via helper functions like spawn_trserver, run_trsession, and decorators like @server, @server.stopfunc.


📦 Installation

TracktorLive is mainly targeted towards Linux-like environments. Windows users are asked to use Windows Subsystem for Linux (WSL) to use our software. For running this software on a Linux-like system, you can run

pip install tracktorlive

For usage in other platforms, see DOCS.


🔁 Example: Print current location of animal

import tracktorlive as trl

server, semm = trl.spawn_trserver("video.mp4", params, n_ind=1, buffer_size=1, realtime=False)
client = trl.spawn_trclient(server.feed_id)

@client
def printloc(data, clock):
    pos = data[0,:,-1]
    print(clock[-1], ":", pos)
    

run_trsession(server, semm, client)

🧪 Real-world Use Cases

We provide eight complete tutorials to demonstrate the capabilities of this software. See out list of tutorials to know more.

While these are the uses we have explored so far, we encourage users to try more things. We have discussed as potential future applications, e.g., 3D tracking using 3 cameras, and camera control to select recording device based on individual's location.

📬 Status

TracktorLive is a still an evolving toolkit. APIs may change slightlly. You're encouraged to adapt parts for your own research or build wrappers that suit your workflow.

For questions or bugs, feel free to open an issue or reach out directly.

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

tracktorlive-0.9.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

tracktorlive-0.9.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file tracktorlive-0.9.0.tar.gz.

File metadata

  • Download URL: tracktorlive-0.9.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for tracktorlive-0.9.0.tar.gz
Algorithm Hash digest
SHA256 77b22865c98cfafd3be913d581699167fdc3d07436f6685bde574403e6c76336
MD5 6c7f7f75339e4ba76631a1e70655ab77
BLAKE2b-256 e774285ecbe5781565f3a2f1f87e10aff92de164ec5fdad544146710cacb6e53

See more details on using hashes here.

File details

Details for the file tracktorlive-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: tracktorlive-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for tracktorlive-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b407b31b6e45fc47856432e8922b35f939ef9e865a6af8bcea3c9288dee53ff7
MD5 462d77b6a4f4caa85fdb29f4b69da155
BLAKE2b-256 1f579dc232716c208d2ecac29092fe2a2fc9559e49c7f9018089e68095662d81

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