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/templates/video_object_detector.md
+135-13
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,6 @@ Video object detection is aimed at detecting object in a video stream with bound
14
14
Video object tracking is a further extension where detected objects are tracked as they move around video frames, in both spatial and temporal directions.
15
15
The illustrated templates provide both manual and automatic ways of tracking objects in videos. In addition to the new video player that supports frame-by-frame video object tracking, the latest release also features a new annotation user interface that is more efficient, ergonomic, and flexible.
16
16
17
-
18
-
19
17
!!! attention "important"
20
18
21
19
1. Video classification and object tracking were available to preview prior to Label Studio version 1.6, but these features are now fully functional and production-ready.
@@ -35,22 +33,17 @@ The prerequisites to use the video object detection feature are as follows:
35
33
36
34
## Key features supported
37
35
38
-
The following key features are supported by the video player.
39
-
40
-
1. The video and object detection use case using the bounding box on the video.
41
-
2. Video segmentation for the video by creating rectangles on the video.
36
+
The following key features are supported by the video player:
42
37
43
-
44
-
!!! attention "important"
45
-
46
-
In the future releases, Timeline segmentation will allow you to label a conversation based on the timeline.
38
+
* The video and object detection use case using the bounding box on the video.
39
+
* Video segmentation for the video by creating rectangles on the video.
47
40
48
41
49
42
## Labeling Configuration
50
43
51
-
The simplest way to get object detection and tracking project is to go in [project settings](/guide/setup.html#Modify-the-labeling-interface) and specify the following labeling configuration.
44
+
The simplest way to get object detection and tracking project is to specify the following labeling configuration in your project settings.
@@ -75,8 +68,11 @@ You can add a [header](/tags/header.html) to provide instructions to the annotat
75
68
76
69
Use the [Video](/tags/video.html) object tag to specify the video data. The `framerate` parameter sets the frame rate of all videos in the project. Check all available parameters on the tag page reference.
Ensure the `frameRate` matches the video's framerate. If your video has defects or variable framerate, it might cause discrepancies. Transcoding the video to a constant framerate before uploading can help.
80
76
81
77
Use the [VideoRectangle](/tags/videorectangle.html) control tag to allow annotators to add rectangles to video frames:
82
78
```xml
@@ -171,6 +167,132 @@ The keyframe format inside `value.sequence` list is the following:
171
167
}
172
168
```
173
169
170
+
### Exporting with interpolated frames
171
+
172
+
By default, only keyframes are included when exporting data.
173
+
174
+
When exporting your annotations, you may want to include interpolated frames. This would ensure that every frame in the video is included.
175
+
176
+
You can accomplish this by using the `interpolate_key_frames` parameter and one of the following methods:
177
+
178
+
179
+
#### Use the API to create an export snapshot with interpolation enabled
180
+
181
+
You can use the Label Studio API to create an export snapshot with keyframe interpolation enabled.
182
+
183
+
**Endpoint:**
184
+
```
185
+
POST /api/projects/{project_id}/exports
186
+
```
187
+
**Request Body:**
188
+
```json
189
+
{
190
+
"title": "Export with Interpolated Keyframes",
191
+
"serialization_options": {
192
+
"interpolate_key_frames": true
193
+
}
194
+
}
195
+
```
196
+
**Example cURL Command:**
197
+
```bash
198
+
curl -X POST 'https://your-label-studio-domain.com/api/projects/{project_id}/exports' \
199
+
-H 'Authorization: Token YOUR_API_KEY' \
200
+
-H 'Content-Type: application/json' \
201
+
--data-raw '{
202
+
"title": "Export with Interpolated Keyframes",
203
+
"serialization_options": {
204
+
"interpolate_key_frames": true
205
+
}
206
+
}'
207
+
```
208
+
**Steps:**
209
+
1.**Create export snapshot:**
210
+
- Send a `POST` request to `/api/projects/{project_id}/exports` with `interpolate_key_frames` set to `true` in the `serialization_options`.
211
+
2.**Check export status:**
212
+
- Poll the export status using `GET /api/projects/{project_id}/exports/{export_id}` until the `status` is `completed`.
213
+
3.**Download the export:**
214
+
- Once the export is completed, download the export file using:
215
+
```
216
+
GET /api/projects/{project_id}/exports/{export_id}/download?exportType=JSON
217
+
```
218
+
- Example cURL Command:
219
+
```bash
220
+
curl -X GET 'https://your-label-studio-domain.com/api/projects/{project_id}/exports/{export_id}/download?exportType=JSON' \
221
+
-H 'Authorization: Token YOUR_API_KEY' \
222
+
-o 'exported_annotations.json'
223
+
```
224
+
225
+
#### Use the Label Studio SDK
226
+
227
+
If you're using the Label Studio SDK, you can create an export with interpolation enabled:
228
+
229
+
**Python code example:**
230
+
231
+
```python
232
+
from label_studio_sdk import Client
233
+
import time
234
+
# Connect to Label Studio
235
+
ls = Client(url='http://localhost:8080', api_key='YOUR_API_KEY')
236
+
# Get your project by ID
237
+
project = ls.get_project(PROJECT_ID)
238
+
# Create an export snapshot with interpolation enabled
0 commit comments