Skip to main content

ACM (Anatomically-constrained model)

A framework for videography based pose tracking of rodents. By Arne Monsees. [In review]

Installation

  1. Install Anaconda
  2. Clone https://github.com/bbo-lab/ACM.git
  3. Start Anaconda Prompt (Windows) / terminal (linux) and navigate into repository directory
  4. Create conda environment conda env create -f https://raw.githubusercontent.com/bbo-lab/ACM/main/environment.yml once repo is public)
  5. Install using pip install .

Testing

  1. Download example dataset.
  2. Start Anaconda Prompt (Windows) / terminal (linux)
  3. Activate conda environment conda activate bbo_acm.
  4. View 2D labels by running python -m ACM --viewer [Path of "table_1_20210511" folder from step 1.]
  5. Run python -m ACM [Path of "table_1_20210511" folder from step 1.] (expected to take around 20 minutes on modern 8-core CPU, tested with an AMD Vega iGPU and a Geforce GTX 1080 Ti)
  6. View 3D tracked pose by running python -m ACM --viewer [Path of "table_1_20210511" folder from step 1.]

Setting up your own dataset config

Overview

Input

A dataset input config consists of a folder with the following files:

  • configuration.py: Configuration file that determines settings and input and out paths.
  • model.npy: Defines the underlying skeleton graph of the animal.
  • multicalibration.npy: Intrinsic and extrinsic camera parameters obtained from calibrating the camera setup.
  • origin_coord.npy: Coordinate system of the final result, relative to the coordinate system of the camera calibration.
  • labels_dlc_n_m.npy: Automatically detected labels on the videography data.
  • labels_manual.npz: Manual labels on the videography data. The labels are required for training a neural network for automated detection of surface markers as well as for learning the animal's antaomy via calibration.py.

Output

A dataset output consists of a folder with the following files:

  • pose.npy: A dictionary containing the inferred 3D joint and marker locations as well as the resulting projected marker locations in the 2D images.
  • save_dict.npy: A dictionary containing the model parameters learned with the EM algorithm (i.e. the initial state and covariance matrix as well as the transition and measurement covariance matrix). Additionally, it also contains the smoothed latent variables and covariance matrices for every time point of the reconstructed sequence, which were generated using the learned model parameters.

Further, the following intermediate files are generated by calibration and initialization:

  • x_calib.npy: A flattened vector containing the latent variables encoding the learned bone lengths, surface marker locations and poses for all time points of the calibration data set, used to learn the animal's anatomy. For the subsequent pipeline only the first few entries of the flattened vector, corresponding to the bone lengths and surface marker locations, are relevant.
  • x_ini.npy: A flattened vector containing the latent variables encoding the learned bone lengths, surface marker locations and poses for the first time point of the sequence, which should be reconstructed.

By default, results are saved into the results subfolder of the datset configuration.

File structure of input and output files

The structure of the inputs is documented in INPUTS.md. The structure of the outputs is documented in OUTPUTS.md.

FAQ

Metadata

Release files for bbo-acm 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bbo-acm 0.2.4
File Size Uploaded Provenance
bbo-acm-0.2.4.tar.gz 55.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bbo-acm 0.2.4
File Interpreter ABI Platform
bbo_acm-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 114.4 kB

Release files / bbo-acm-0.2.4.tar.gz

Download URL bbo-acm-0.2.4.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf5679458c97d0e01466af720605650dbfa90f20e59063df0f1959fb6c4404bc
BLAKE2b-256 checksum
How to use checksums
12d7e5dbdd1bfdcae46d77d5346472ceb7ac64ea48578efb51469974fbdc3fde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / bbo_acm-0.2.4-py3-none-any.whl

Download URL bbo_acm-0.2.4-py3-none-any.whl
Size 59.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
872b628c733e7d7363b80b817549b0ba31e60cf2dbe343fb225c932efdead153
BLAKE2b-256 checksum
How to use checksums
d176663125b37bb9fce5695160d1cd990fdc41c7f7c63a6ee7da100b85363e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for bbo-acm 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page