You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package contains a [DeepLabCut](http://www.mousemotorlab.org/deeplabcut) inference pipeline for real-time applications that has minimal (software) dependencies. Thus, it is as easy to install as possible (in particular, on atypical systems like [NVIDIA Jetson boards](https://developer.nvidia.com/buy-jetson)).
15
-
16
-
**Performance:** If you would like to see estimates on how your model should perform given different video sizes, neural network type, and hardware, please see: https://deeplabcut.github.io/DLC-inferencespeed-benchmark/
17
-
18
-
If you have different hardware, please consider submitting your results too! https://github.com/DeepLabCut/DLC-inferencespeed-benchmark
19
-
20
-
**What this SDK provides:** This package provides a `DLCLive` class which enables pose estimation online to provide feedback. This object loads and prepares a DeepLabCut network for inference, and will return the predicted pose for single images.
21
-
22
-
To perform processing on poses (such as predicting the future pose of an animal given it's current pose, or to trigger external hardware like send TTL pulses to a laser for optogenetic stimulation), this object takes in a `Processor` object. Processor objects must contain two methods: process and save.
23
-
24
-
- The `process` method takes in a pose, performs some processing, and returns processed pose.
14
+
This package contains a [DeepLabCut](http://www.mousemotorlab.org/deeplabcut) inference
15
+
pipeline for real-time applications that has minimal (software) dependencies. Thus, it
16
+
is as easy to install as possible (in particular, on atypical systems like [
**What this SDK provides:** This package provides a `DLCLive` class which enables pose
33
+
estimation online to provide feedback. This object loads and prepares a DeepLabCut
34
+
network for inference, and will return the predicted pose for single images.
35
+
36
+
To perform processing on poses (such as predicting the future pose of an animal given
37
+
its current pose, or to trigger external hardware like send TTL pulses to a laser for
38
+
optogenetic stimulation), this object takes in a `Processor` object. Processor objects
39
+
must contain two methods: `process` and `save`.
40
+
41
+
- The `process` method takes in a pose, performs some processing, and returns processed
42
+
pose.
25
43
- The `save` method saves any valuable data created by or used by the processor
26
44
27
45
For more details and examples, see documentation [here](dlclive/processor/README.md).
28
46
29
-
###### 🔥🔥🔥🔥🔥 Note :: alone, this object does not record video or capture images from a camera. This must be done separately, i.e. see our [DeepLabCut-live GUI](https://github.com/gkane26/DeepLabCut-live-GUI).🔥🔥🔥
30
-
31
-
### News!
32
-
- March 2022: DeepLabCut-Live! 1.0.2 supports poetry installation `poetry install deeplabcut-live`, thanks to PR #60.
33
-
- March 2021: DeepLabCut-Live! [**version 1.0** is released](https://pypi.org/project/deeplabcut-live/), with support for tensorflow 1 and tensorflow 2!
34
-
- Feb 2021: DeepLabCut-Live! was featured in **Nature Methods**: ["Real-time behavioral analysis"](https://www.nature.com/articles/s41592-021-01072-z)
35
-
- Jan 2021: full **eLife** paper is published: ["Real-time, low-latency closed-loop feedback using markerless posture tracking"](https://elifesciences.org/articles/61909)
36
-
- Dec 2020: we talked to **RTS Suisse Radio** about DLC-Live!: ["Capture animal movements in real time"](https://www.rts.ch/play/radio/cqfd/audio/capturer-les-mouvements-des-animaux-en-temps-reel?id=11782529)
37
-
38
-
39
-
### Installation:
40
-
41
-
Please see our instruction manual to install on a [Windows or Linux machine](docs/install_desktop.md) or on a [NVIDIA Jetson Development Board](docs/install_jetson.md). Note, this code works with tensorflow (TF) 1 or TF 2 models, but TF requires that whatever version you exported your model with, you must import with the same version (i.e., export with TF1.13, then use TF1.13 with DlC-Live; export with TF2.3, then use TF2.3 with DLC-live).
47
+
**🔥🔥🔥🔥🔥 Note :: alone, this object does not record video or capture images from a
48
+
camera. This must be done separately, i.e. see our [DeepLabCut-live GUI](
Please see our instruction manual to install on a [Windows or Linux machine](
69
+
docs/install_desktop.md) or on a [NVIDIA Jetson Development Board](
70
+
docs/install_jetson.md). Note, this code works with PyTorch, TensorFlow 1 or TensorFlow
71
+
2 models, but whatever engine you exported your model with, you must import with the
72
+
same version (i.e., export a PyTorch model, then install PyTorch, export with TF1.13,
73
+
then use TF1.13 with DlC-Live; export with TF2.3, then use TF2.3 with DLC-live).
42
74
43
75
- available on pypi as: `pip install deeplabcut-live`
44
76
45
77
Note, you can then test your installation by running:
46
78
47
79
`dlc-live-test`
48
80
49
-
If installed properly, this script will i) create a temporary folder ii) download the full_dog model from the [DeepLabCut Model Zoo](http://www.mousemotorlab.org/dlc-modelzoo), iii) download a short video clip of a dog, and iv) run inference while displaying keypoints. v) remove the temporary folder.
81
+
If installed properly, this script will i) create a temporary folder ii) download the
82
+
full_dog model from the [DeepLabCut Model Zoo](
83
+
http://www.mousemotorlab.org/dlc-modelzoo), iii) download a short video clip of
84
+
a dog, and iv) run inference while displaying keypoints. v) remove the temporary folder.
50
85
51
86
<imgsrc="https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/1606081086014-TG9GWH63ZGGOO7K779G3/ke17ZwdGBToddI8pDm48kHiSoSToKfKUI9t99vKErWoUqsxRUqqbr1mOJYKfIPR7LoDQ9mXPOjoJoqy81S2I8N_N4V1vUb5AoIIIbLZhVYxCRW4BPu10St3TBAUQYVKcOoIGycwr1shdgJWzLuxyzjLbSRGBFFxjYMBr42yCvRK5HHsLZWtMlAHzDU294nCd/dlclivetest.png?format=1000w"width="650"title="DLC-live-test"alt="DLC LIVE TEST"align="center"vspace = "50">
52
87
53
-
### Quick Start: instructions for use:
88
+
PyTorch and TensorFlow can be installed as extras with `deeplabcut-live` - though be
-`<path to exported model directory>` = path to the folder that has the `.pb` files that you acquire after running `deeplabcut.export_model`
86
132
-`<your image>` = is a numpy array of each frame
87
133
134
+
### Switching from TensorFlow to PyTorch
135
+
136
+
This section is for users who **have already used DeepLabCut-Live** with
137
+
TensorFlow models (through DeepLabCut 1.X or 2.X) and want to switch to using the
138
+
PyTorch Engine. Some quick notes:
139
+
140
+
- You may need to adapt your code slightly when creating the DLCLive instance.
141
+
- Processors that were created for TensorFlow models will function the same way with
142
+
PyTorch models. As multi-animal models can be used with PyTorch, the shape of the `pose`
143
+
array given to the processor may be `(num_individuals, num_keypoints, 3)`. Just call
144
+
`DLCLive(..., single_animal=True)` and it will work.
88
145
89
146
### Benchmarking/Analyzing your exported DeepLabCut models
90
147
91
-
DeepLabCut-live offers some analysis tools that allow users to peform the following operations on videos, from python or from the command line:
148
+
DeepLabCut-live offers some analysis tools that allow users to perform the following
149
+
operations on videos, from python or from the command line:
150
+
151
+
#### Test inference speed across a range of image sizes
152
+
153
+
Downsizing images can be done by specifying the `resize` or `pixels` parameter. Using
154
+
the `pixels` parameter will resize images to the desired number of `pixels`, without
155
+
changing the aspect ratio. Results will be saved (along with system info) to a pickle
156
+
file if you specify an output directory.
157
+
158
+
Inside a **python** shell or script, you can run:
92
159
93
-
1. Test inference speed across a range of image sizes, downsizing images by specifying the `resize` or `pixels` parameter. Using the `pixels` parameter will resize images to the desired number of `pixels`, without changing the aspect ratio. Results will be saved (along with system info) to a pickle file if you specify an output directory.
2. Display keypoints to visually inspect the accuracy of exported models on different image sizes (note, this is slow and only for testing purposes):
175
+
#### Display keypoints to visually inspect the accuracy of exported models on different image sizes (note, this is slow and only for testing purposes):
3. Analyze and create a labeled video using the exported model and desired resize parameters. This option functions similar to `deeplabcut.benchmark_videos` and `deeplabcut.create_labeled_video` (note, this is slow and only for testing purposes).
197
+
#### Analyze and create a labeled video using the exported model and desired resize parameters.
198
+
199
+
This option functions similar to `deeplabcut.benchmark_videos` and
200
+
`deeplabcut.create_labeled_video` (note, this is slow and only for testing purposes).
This project is licensed under the GNU AGPLv3. Note that the software is provided "as is", without warranty of any kind, express or implied. If you use the code or data, we ask that you please cite us! This software is available for licensing via the EPFL Technology Transfer Office (https://tto.epfl.ch/, [email protected]).
225
+
This project is licensed under the GNU AGPLv3. Note that the software is provided "as
226
+
is", without warranty of any kind, express or implied. If you use the code or data, we
227
+
ask that you please cite us! This software is available for licensing via the EPFL
228
+
Technology Transfer Office (https://tto.epfl.ch/, [email protected]).
128
229
129
230
## Community Support, Developers, & Help:
130
231
131
-
This is an actively developed package and we welcome community development and involvement.
132
-
133
-
- If you want to contribute to the code, please read our guide [here](https://github.com/DeepLabCut/DeepLabCut/blob/master/CONTRIBUTING.md), which is provided at the main repository of DeepLabCut.
134
-
135
-
- We are a community partner on the [](https://forum.image.sc/tags/deeplabcut). Please post help and support questions on the forum with the tag DeepLabCut. Check out their mission statement [Scientific Community Image Forum: A discussion forum for scientific image software](https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3000340).
136
-
137
-
- If you encounter a previously unreported bug/code issue, please post here (we encourage you to search issues first): https://github.com/DeepLabCut/DeepLabCut-live/issues
138
-
139
-
- For quick discussions here: [](https://gitter.im/DeepLabCut/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
232
+
This is an actively developed package, and we welcome community development and
233
+
involvement.
234
+
235
+
- If you want to contribute to the code, please read our guide [here](
236
+
https://github.com/DeepLabCut/DeepLabCut/blob/master/CONTRIBUTING.md), which is provided
237
+
at the main repository of DeepLabCut.
238
+
- We are a community partner on the [](https://forum.image.sc/tags/deeplabcut). Please post help and
239
+
support questions on the forum with the tag DeepLabCut. Check out their mission
240
+
statement [Scientific Community Image Forum: A discussion forum for scientific image
If you utilize our tool, please [cite Kane et al, eLife 2020](https://elifesciences.org/articles/61909). The preprint is available here: https://www.biorxiv.org/content/10.1101/2020.08.04.236422v2
251
+
If you utilize our tool, please [cite Kane et al, eLife 2020](https://elifesciences.org/articles/61909). The preprint is
252
+
available here: https://www.biorxiv.org/content/10.1101/2020.08.04.236422v2
144
253
145
254
```
146
255
@Article{Kane2020dlclive,
@@ -150,4 +259,3 @@ If you utilize our tool, please [cite Kane et al, eLife 2020](https://elifescien
0 commit comments