Skip to main content

Anatomically constraint pose reconstruction from video data

Project description

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

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

bbo-acm-0.2.4.tar.gz (55.2 kB view details)

Uploaded Source

Built Distribution

bbo_acm-0.2.4-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file bbo-acm-0.2.4.tar.gz.

File metadata

  • Download URL: bbo-acm-0.2.4.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bbo-acm-0.2.4.tar.gz
Algorithm Hash digest
SHA256 bf5679458c97d0e01466af720605650dbfa90f20e59063df0f1959fb6c4404bc
MD5 1e3fe19c81d72acb6f220a264f2a7e04
BLAKE2b-256 12d7e5dbdd1bfdcae46d77d5346472ceb7ac64ea48578efb51469974fbdc3fde

See more details on using hashes here.

File details

Details for the file bbo_acm-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: bbo_acm-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bbo_acm-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 872b628c733e7d7363b80b817549b0ba31e60cf2dbe343fb225c932efdead153
MD5 0d99ece7800e5f68bfb83ad98ac66457
BLAKE2b-256 d176663125b37bb9fce5695160d1cd990fdc41c7f7c63a6ee7da100b85363e1f

See more details on using hashes here.

Supported by

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