Skip to content

Commit fe43814

Browse files
author
Manuel Manso
committed
Update docs
1 parent 4d4d3ea commit fe43814

6 files changed

Lines changed: 122 additions & 9 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Set these according to your project, your name and the current date
2+
Task: project_name
3+
scorer: your_name
4+
date: current_date
5+
6+
# Project path (change when moving around)
7+
project_path: path/to/project/directory
8+
9+
# Annotation data set configuration (and individual video cropping parameters)
10+
# If you only want to label one video, you can simply remove the path of the second video
11+
video_sets:
12+
path/to/video1:
13+
crop: 0, 2000, 0, 200
14+
path/to/video2:
15+
crop: 0, 2000, 0, 200
16+
bodyparts:
17+
- Left Hand
18+
- Head
19+
- Right Leg
20+
21+
# You can just leave start=0 and stop=1
22+
start: 0
23+
stop: 1
24+
25+
# This parameter sets how many frames will be generated for you to label
26+
numframes2pick: 10
31.2 KB
Loading
49.1 KB
Loading
62.9 KB
Loading

docs/source/modules/label-deeplabcut.rst

Lines changed: 90 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,125 @@ This module allows you to label a video according to a DeepLabCut config file. R
1212
How to use
1313
------------------------
1414

15-
| 1. Open the **"Modules"** tab and choose the **"Label DeepLabCut"** module.
16-
|
15+
| 1. :ref:`Setup the project. <setup-label>`
16+
|
1717
| 2. :ref:`Import the videos to label from a YAML file. <import-YAML-label>`
1818
|
1919
| 3. :ref:`Label the videos. <labeling-videos-label>`
2020
|
2121
| 4. :ref:`Export the labeled videos to a CSV file. <exporting-csv-label>`
2222
|
2323
24+
.. _setup-label:
25+
26+
----------------------------
27+
Setup the project
28+
----------------------------
29+
30+
**1.** Create a directory for your project. You can name it whatever you want.
31+
32+
**2.** Create a yaml config file for the project. Put it in the project directory.
33+
34+
The config file should contain the path to all the videos you want to label, the path to your project directory, the parts you want
35+
to label and the number of frames you want to label. This is an example of how it should be structured: :download:`config file <../_static/modules/config.yaml>`.
36+
37+
You can download the file and change it to suit your project.
38+
39+
**3.** Create a directory named **"videos"** inside the project directory.
40+
41+
**4.** Put all the videos you want to label inside the **"videos"** directory.
42+
43+
**5.** Create a directory named **"labeled-data"** inside the project directory.
44+
45+
The parent directory should now look like this:
46+
47+
.. image:: /_static/modules/deeplabcut-project-directory.png
48+
49+
**6.** This step is done. Now move to the next step of :ref:`importing the videos. <import-YAML-label>`
50+
51+
|
52+
2453
.. _import-YAML-label:
2554

2655
---------------------------
2756
Importing from a YAML file
2857
---------------------------
2958

59+
60+
**1.** Open the **"Modules"** tab and choose the **"Label DeepLabCut"** module.
61+
62+
**2.** Choose the yaml to import from. To do this, click the **"Open"** button to the right of **"YAML to import from"** and then browse your folders until you find the file.
63+
64+
**3.** Click the **"Import"** button. Now the deeplabcut module will run and extract as many frames from the video as defined in the config file. This might take a while. You can track the progress in the command line. Once it's finished, a message will pop up informing you that the import is finished.
65+
66+
**4.** This step is done. Now move to the next step of :ref:`labeling the videos. <labeling-videos-label>`
67+
68+
|
69+
3070
.. _labeling-videos-label:
3171

3272
------------------------
3373
Labeling the videos
3474
------------------------
3575

76+
Now you should have one or more videos created. Each video should have an object for each of the parts you want to label, and each part should have a path. Your timeline should also have a row for each one of the videos you're labeling.
77+
78+
Each frame you want to label is represented in the timeline as an event. It should look like a small vertical purple bar.
79+
80+
**1.** **Select the row** of the video you're about to label in the timeline. In most cases this should be the first row of the timeline. It should become highlighted in blue. Right now, your project should look like this:
81+
82+
.. image:: /_static/modules/deeplabcut-project.png
83+
84+
**2.** Now you have to go through each frame, and for each object, select its path, then click the **"Mark Point"** button and then select its location with the **Left Mouse Button**.
85+
86+
You can do all of this using only the mouse, but to help you be more productive, there are a couple of very useful shortcuts:
87+
88+
- **U** - Selects the path of the next object and also clicks the **"Mark point"** button.
89+
- **I** - Moves to the next event and also clicks the **"Mark point"** button.
90+
- **O** - If a path is selected, clicks the **"Mark point"** button.
91+
92+
- **E** - Moves to the next event. If no event is selected, moves to the first event.
93+
- **Q** - Moves to the previous event. If no event is selected, moves to the last event.
94+
95+
To quickly label, you should either:
96+
97+
- Label an object in all frames using the **I** shortcut
98+
- Label all object in a frame using the **U** shortcut and then move to the next frame with the **E** shortcut
99+
100+
.. note:: You can select the color of each object's path, thereby changing the color of its "Mark point" marker on the right side. Simply click on **"Choose a color"** and then select the color you want.
101+
102+
**3.** To see if you maybe missed labeling one of the frames, you can do this:
103+
104+
1. Open the **"Modules"** tab and choose the **"Label DeepLabCut"** module.
105+
2. Click the **"Check unlabeled frames"** button.
106+
3. A text file will be created in your current directory. This text file tells you for each video and each part, what frames you still haven't labeled. If a part has no frames specified, then you have labeled that object in every frame.
107+
108+
**4.** Once you don't have any frames left to label, you can move to the next step of :ref:`exporting to a csv file. <exporting-csv-label>`
109+
110+
|
111+
36112
.. _exporting-csv-label:
37113

38114
------------------------
39115
Exporting to a CSV file
40116
------------------------
41117

118+
**1.** Open the **"Modules"** tab and choose the **"Label DeepLabCut"** module.
42119

43-
------------------------
44-
Result
45-
------------------------
120+
**2.** Choose the directory you want the file to be written to. To do this, click the **"Open"** button to the right of **"Output directory"** and then browse your folders to select the one you want.
46121

47-
The result will be a csv file for each labeled video.
122+
**3.** Choose the name you want for csv file. You simply have to write the name in the textbox to the right of **"Output file name"**. The **".csv"** extension will be automatically added to the end.
123+
124+
**4.** Click the **"Export"** button. The resulting csv file will now be in the directory you chose before.
125+
126+
**5.** You're done with the labeling of the videos. Now you can use deeplabcut to analyse the resulting csv file.
48127

49128
|
50129
51130
------------------------
52-
Example
131+
Result
53132
------------------------
133+
134+
The result will be a csv file for each labeled video. The csv file will look like this:
135+
136+
.. image:: /_static/modules/deeplabcut-csv-result.png

docs/source/user-docs/install_and_run/index.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,13 @@ Run the following commands:
129129
pip install -U wxPython
130130
pip install --ignore-installed tensorflow==1.10
131131
132-
**for ubuntu:**
132+
**for linux:**
133133

134-
Run the following commands:
134+
| Go to this link: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/.
135+
| There you will have to choose your linux distribution and the wheel for Python 3.6.
136+
| Then run the commands under, but replace the middle command with whatever fits your linux distribution.
137+
|
138+
| For example, if you have ubuntu 18.04, you will have to run the following commands:
135139
136140
.. code-block:: bash
137141

0 commit comments

Comments
 (0)