dlc_flytracker
Python package for the tracking the 3d kinematics of animals (currently only flies) build around DeepLabCut
Introduction
The package allow the fitting of an animal (chosen) 3d skeleton to the tracking results from DeepLabCut.
The usual steps:
- Post-processing of video recordings (at least 2 cameras): image enhancement, dynamic cropping around moving animal and the stitching of multiple camera views (to improve tracking with DeepLabCut)
- Define the joints of the animal skeleton that will be used for the tracking. You can use a previously made skeleton (e.g. flies), or make your own from body modules (see the section ??? below to see an example).
- (Outside this package) Training of a DeepLabCut (DLC) network: usually done using the DLC user interface. Require to manually label 100-200 images. See the section ??? below to see an example, and how DLC settings can be tweaked in order to get good tracking results with stitched images.
- Run DLC tracking on the full dataset
- Load the DLC results in dlc_flytracker
- Reconstruct 3d coordinates of the skeleton joints from their 2d coordinates tracked with DeepLabCut
- Optimize fit the 3d skeleton to the 2d/3d coordinates of the joints
- Post-processing of the kinematics parameters
Citation
???
Getting Started
Prerequisite
dlc_flytracker requires deeplabcut
, tensorflow
and other common packages like numpy
, scipy
, matplotlib
. For a full list, you can check the file requirements.txt
Installing
???
Usage
Here the main steps introduced earlier are explained in details with examples.
Post-processing of video recordings
??? (at least 2 cameras):
- Image enhancement: ???
- Dynamic cropping around moving animal: ???
- Stitching of multiple camera views: ??? (to improve tracking with DeepLabCut)
Build animal skeleton
???
in DeepLabCut
???
in dlc_flytracker
???
Training a network in DeepLabCut
- ??? using the DLC user interface. Require to manually label 100-200 images. See the section ??? below to see an example, and how DLC settings can be tweaked in order to get good tracking results with stitched images.
Run DLC tracking on the full dataset
???
Load the DLC results in dlc_flytracker
???
Reconstruct 3d coordinates of the skeleton joints from their 2d coordinates tracked with DeepLabCut
???
Optimize fit the 3d skeleton to the 2d/3d coordinates of the joints
???
Post-processing of the kinematics parameters
???
Notes
Running the tests
To run tests locally, type:
> pytest dlc_flytracker
License
This project utilizes the LGPL LICENSE. Allows developers and companies to use and integrate a software component released under the LGPL into their own (even proprietary) software without being required by the terms of a strong copyleft license to release the source code of their own components. However, any developer who modifies an LGPL-covered component is required to make their modified version available under the same LGPL license.