https://github.com/bonsai-rx/sleap

A Bonsai interface for real-time multi-animal pose tracking using SLEAP

https://github.com/bonsai-rx/sleap

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

bonsai-rx computer-vision

Keywords from Contributors

zeromq pulsepal
Last synced: 10 months ago · JSON representation

Repository

A Bonsai interface for real-time multi-animal pose tracking using SLEAP

Basic Info
Statistics
  • Stars: 8
  • Watchers: 3
  • Forks: 7
  • Open Issues: 7
  • Releases: 5
Topics
bonsai-rx computer-vision
Created about 4 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

docs/README.md

Bonsai - SLEAP

logo

Bonsai.SLEAP is a Bonsai interface for SLEAP allowing multi-animal, real-time, pose and identity estimation using pretrained network models stored in a Protocol buffer (.pb) format.

Bonsai.SLEAP loads these .pb files using TensorFlowSharp, a set of .NET bindings for TensorFlow allowing native inference using either the CPU or GPU. By using the .pb file and the corresponding configuration file (training_config.json), the PredictFullModelPose operator from Bonsai.SLEAP will push the live image data through the inference network and output a set of identified poses from which you can extract an object id and specific object part position. Bonsai can then leverage this data to drive online effectors or simply save it to an output file.

The Bonsai.SLEAP package came about following a fruitful discussion with the SLEAP team during the Quantitative Approaches to Behaviour.

How to install

Bonsai.SLEAP can be downloaded through the Bonsai package manager. In order to get visualizer support, you should download both the Bonsai.SLEAP and Bonsai.SLEAP.Design packages. However, in order to use it for either CPU or GPU inference, you need to pair it with a compiled native TensorFlow binary. You can find precompiled binaries for Windows 64-bit at https://www.tensorflow.org/install/lang_c.

To use GPU TensorFlow (highly recommended for live inference), you also need to install the CUDA Toolkit and the cuDNN libraries. The current SLEAP package was developed and tested with CUDA v11.3 and cuDNN 8.2. Additionally, make sure you have a CUDA compatible GPU with the latest NVIDIA drivers.

After downloading the native TensorFlow binary and cuDNN, you can follow these steps to get the required native files into the Extensions folder of your local Bonsai install:

  1. The easiest way to find your Bonsai install folder is to right-click on the Bonsai shortcut > Properties. The path to the folder will be shown in the "Start in" textbox;
  2. Copy tensorflow.dll file from either the CPU or GPU tensorflow release to the Extensions folder;
  3. If you are using TensorFlow GPU, make sure to add the cuda/bin folder of your cuDNN download to the PATH environment variable, or copy all DLL files to the Extensions folder.

How to use

Bonsai.SLEAP currently implements the following SLEAP networks through the correspondent Bonsai operator:

  • centroid:
    • Input : full frame with potentially multiple objects
    • Output : collection of multiple detected centroids in the input image
    • Operator : PredictCentroid
  • top-down-model:
    • Input : full frame with potentially multiple objects
    • Output : collection of detected poses (centroid + body parts) from multiple objects in the image
    • Operator : PredictPoses
  • top-down-id-model:
    • Input : full frame with potentially multiple objects
    • Output : collection of detected poses (centroid + body parts) plus identities from multiple objects in the image
    • Operator : PredictPoseIdentities
  • single_instance:
    • Input : croped instance with a single object in the input image
    • Output : returns a single pose (body parts)
    • Operator : PredictSinglePose

The general Bonsai workflow will thus be:

Bonsai_Pipeline

Additional information can be extracted by selecting the relevant structure fields.

Bonsai_Pipeline_expanded

In order to use the Predict operators, you will need to provide the ModelFileName to the exported .pb file folder containing your pretrained SLEAP model, along with the corresponding PoseConfigFileName to the training_config.json file.

If everything works out, you should see some indications in the Bonsai command line window about whether the GPU was successfully detected and enabled. The first frame will cold start the inference graph which may take a bit of time, but after that your poses should start streaming through!

SLEAP installation

For all questions regarding installation of SLEAP, please check the official docs.

Owner

  • Name: Bonsai
  • Login: bonsai-rx
  • Kind: organization

A visual language for reactive programming

GitHub Events

Total
  • Create event: 3
  • Release event: 1
  • Issues event: 3
  • Watch event: 1
  • Issue comment event: 5
  • Push event: 3
  • Pull request review event: 1
  • Pull request event: 4
  • Fork event: 1
Last Year
  • Create event: 3
  • Release event: 1
  • Issues event: 3
  • Watch event: 1
  • Issue comment event: 5
  • Push event: 3
  • Pull request review event: 1
  • Pull request event: 4
  • Fork event: 1

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 125
  • Total Committers: 5
  • Avg Commits per committer: 25.0
  • Development Distribution Score (DDS): 0.352
Past Year
  • Commits: 4
  • Committers: 2
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
glopesdev g****v 81
Bruno Cruz b****z@g****m 35
Shawn Tan b****n@g****m 5
David Maas d****t@n****g 2
Shrivaths Shyam s****8@g****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

Packages

  • Total packages: 2
  • Total downloads:
    • nuget 4,421 total
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 10
  • Total maintainers: 2
nuget.org: bonsai.sleap

Bonsai Library for real-time multi-pose tracking using SLEAP. TensorFlow 2.8.0 or compatible is required.

  • Versions: 6
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 2,750 Total
Rankings
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Average: 24.3%
Downloads: 40.1%
Maintainers (2)
Last synced: 11 months ago
nuget.org: bonsai.sleap.design

Bonsai Library containing reactive visualizations for markerless multi-pose estimation using SLEAP.

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 1,671 Total
Rankings
Dependent repos count: 13.8%
Dependent packages count: 18.8%
Average: 25.6%
Downloads: 44.2%
Maintainers (2)
Last synced: 11 months ago

Dependencies

.github/workflows/docs.yml actions
  • actions/checkout v2 composite
  • crazy-max/ghaction-chocolatey v1 composite
  • microsoft/setup-msbuild v1 composite
  • peaceiris/actions-gh-pages v3 composite
src/Bonsai.Sleap/Bonsai.Sleap.csproj nuget
  • Bonsai.Core 2.7.0
  • OpenCV.Net 3.4.1
  • TensorFlowSharp-Lite 2.8.0
  • YamlDotNet 12.0.2
src/Bonsai.Sleap.Design/Bonsai.Sleap.Design.csproj nuget
  • Bonsai.Vision.Design 2.7.0