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
Copy file name to clipboardExpand all lines: docs/source/modules/label-deeplabcut.rst
+90-7Lines changed: 90 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,42 +12,125 @@ This module allows you to label a video according to a DeepLabCut config file. R
12
12
How to use
13
13
------------------------
14
14
15
-
|1. Open the **"Modules"** tab and choose the **"Label DeepLabCut"** module.
16
-
|
15
+
|1. :ref:`Setup the project. <setup-label>`
16
+
|
17
17
|2. :ref:`Import the videos to label from a YAML file. <import-YAML-label>`
18
18
|
19
19
|3. :ref:`Label the videos. <labeling-videos-label>`
20
20
|
21
21
|4. :ref:`Export the labeled videos to a CSV file. <exporting-csv-label>`
22
22
|
23
23
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.
**6.** This step is done. Now move to the next step of :ref:`importing the videos. <import-YAML-label>`
50
+
51
+
|
52
+
24
53
.. _import-YAML-label:
25
54
26
55
---------------------------
27
56
Importing from a YAML file
28
57
---------------------------
29
58
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
+
30
70
.. _labeling-videos-label:
31
71
32
72
------------------------
33
73
Labeling the videos
34
74
------------------------
35
75
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:
**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
+
36
112
.. _exporting-csv-label:
37
113
38
114
------------------------
39
115
Exporting to a CSV file
40
116
------------------------
41
117
118
+
**1.** Open the **"Modules"** tab and choose the **"Label DeepLabCut"** module.
42
119
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.
46
121
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.
48
127
49
128
|
50
129
51
130
------------------------
52
-
Example
131
+
Result
53
132
------------------------
133
+
134
+
The result will be a csv file for each labeled video. The csv file will look like this:
0 commit comments