File size: 38,133 Bytes
95f5290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
# processor Project Guide

processor is a system for receiving, processing, reviewing, and exporting data.

This guide keeps the project features, pages, screenshots, and operating instructions in one document. Read it from top to bottom without switching between multiple files.

## Contents

1. [Overall process](#1-overall-process)
2. [Installation and startup](#2-installation-and-startup)
3. [Home](#3-home)
4. [Projects and received data](#4-projects-and-received-data)
5. [Workflow](#5-workflow)
6. [Data annotation](#6-data-annotation)
7. [Video viewing and review](#7-video-viewing-and-review)
8. [Approved data and export](#8-approved-data-and-export)
9. [Failed data](#9-failed-data)
10. [Trash](#10-trash)
11. [Frequently asked questions](#11-frequently-asked-questions)
12. [Data and program information](#12-data-and-program-information)
13. [Code structure and responsibilities](#13-code-structure-and-responsibilities)

## 1. Overall process

The complete process is:

    Install and start
      ↓
    Open Home
      ↓
    Create or select a project
      ↓
    Receive data
      ↓
    Select and run a workflow
      ↓
    View videos and processing results
      ↓
    Annotate, inspect, and review
      ↓
    Export data

The main pages currently available in the system are:

- Home: view the overall data status;
- Projects: view projects and Episodes;
- Workflow: configure and run workflows;
- Annotation: manage annotations;
- Video Review: view videos and review data;
- Trash: view deleted data.

The Users feature is still under development and is not included in the current operating process.

## 2. Installation and startup

### 2.1 Download and open the project

After downloading the project, open:

    processor/

### 2.2 Start the program

Linux:

    cd processor
    python deploy.py

To check the computer environment without starting the services:

    python deploy.py --check-only

When using an external AI API:

    python deploy.py --skip-vllm

Windows users can run the Windows deployment script included in the project.

### 2.3 Open the web page

Wait for the services to start, then open the address provided by the administrator in a browser.

When the sign-in page appears, the web application has started. Open:

    /health

to check whether the service is healthy.

> Screenshot to be added: successful startup and sign-in page.

### 2.4 If something goes wrong

- If the page does not open, check whether the backend is running.
- If data is not processed, check whether the Worker is running.
- After a workflow is configured, matching uploaded data should run through it automatically. If processing does not start, check the workflow or run it manually.

## 3. Home

### 3.1 What is Home for?

Home shows the overall status of all data.

### 3.2 Home page

![Home page](../images/02-home-annotated.png)

The numbered areas are:

1. Left navigation menu;
2. Summary statistics;
3. Project list;
4. Recent data;
5. Refresh button.

### 3.3 Data statuses

| Status | Meaning |
| --- | --- |
| Reviewing | Waiting for or undergoing inspection |
| Approved | Review passed |
| Failed | Processing failed |
| Trash | Deleted and recoverable |

### 3.4 How to use it

1. Sign in and open Home.
2. Check the summary statistics at the top.
3. Click a project name to view the project.
4. If the data is not current, click Refresh in the upper-right corner.

### 3.5 What indicates normal operation?

When data changes from Reviewing to Approved, its inspection is complete and it has passed review.

If Processing remains visible, wait and refresh the page. If it still does not change, check the Worker.

## 4. Projects and received data

### 4.1 What is a project?

A project stores a related group of data. One project can contain multiple Episodes.

processor receives data sent by the collector and stores it in the corresponding project. Data acquisition itself does not take place inside processor.

### 4.2 View existing projects

Open <code>Projects</code> in the left navigation to view existing projects and received data.

[![Project list](../images/projects-list-annotated.png)](../images/projects-list-annotated.png)

The numbered controls are:

1. <code>Search projects</code>: enter a project name to find it quickly;
2. <code>New Project</code>: create a new project that will receive data;
3. <code>Project information</code>: view the project name, status, workflow, observed inputs, Episode count, and receiving statistics;
4. <code>Edit Project</code>: change the project name, workflow, or status;
5. <code>Delete</code>: delete the current project. Deleted data can be viewed in Trash;
6. <code>Expand received batches</code>: click the project row or the arrow on the right to view received batches and Episodes.

<code>active</code> means the project is in use and can continue receiving data. <code>paused</code> means the project is paused.

### 4.3 Create a project

Click <code>New Project</code> in the upper-right corner and enter the project information.

[![Create a project](../images/project-new-annotated.png)](../images/project-new-annotated.png)

The fields are:

- <code>Project Name</code>: the project name;
- <code>Workflow</code>: bind one current workflow to the project. You may create a new empty workflow or select an existing workflow;
- <code>Status</code>: <code>active</code> enables the project and <code>paused</code> pauses it;
- <code>Target Episodes</code>: planned number of Episodes. <code>0</code> means no limit;
- <code>Description</code>: optional project description;
- <code>Save</code>: save the project.

The project name cannot be empty. After a new project is saved, the system asks whether you want to open the Workflow page and continue configuration.

### 4.4 Select a workflow

Select the required workflow from the <code>Workflow</code> field on the project form.

[![Select a project workflow](../images/project-workflow-select-annotated.png)](../images/project-workflow-select-annotated.png)

The workflow list provides:

1. Click the <code>Workflow</code> field to open the workflow list;
2. Click <code>+ New Workflow</code> to create an empty workflow;
3. A workflow with the <code>Template</code> tag is a template workflow;
4. Click an existing workflow name to bind it to the current project;
5. Click the button on the right to open and edit that workflow.

One project uses one current workflow. Selecting another workflow saves it as the project's new current workflow binding.

Choose according to the input data:

- Choose an RGB workflow for RGB data.
- Choose an RGB-D workflow for RGB plus Depth data.
- Choose a workflow containing Glove Sensor when glove sensor data is present.
- If you are unsure, confirm the project's input types before making a selection.

### 4.5 Data receiving process

    Collector generates data
      ↓
    Collector sends data
      ↓
    processor receives data
      ↓
    Extract and inspect
      ↓
    Match the project and workflow
      ↓
    New Episodes appear in the project

### 4.6 How to receive data

1. Create a project and select the correct workflow.
2. Keep the project status set to <code>active</code>.
3. Send data from the collector to processor.
4. Wait for processor to receive, extract, and inspect the data.
5. Expand the project and confirm that the new batch and Episodes appear.

When a project already has a workflow, the system processes newly received data. Without a bound workflow, data is only received and stored. If a workflow is bound and saved later, the system processes the existing batches.

### 4.7 Important notes

- Do not close the collector's sending program while data is being transferred.
- Do not send the same data again before extraction and inspection finish.
- Each Episode should contain its corresponding video or sensor data.
- If receiving fails, read the failure message before sending or processing the data again.
- Do not force a workflow to run when the project inputs do not match it.

## 5. Workflow

### 5.1 What is a workflow?

A workflow determines how received data is processed.

    Input data β†’ Process data β†’ Inspect results β†’ Export data

### 5.2 Workflow page

Click <code>Workflow</code> in the left navigation.

[![Workflow page](../images/workflow-empty-annotated.png)](../images/workflow-empty-annotated.png)

The numbered controls are:

1. <code>Workflow selector</code>: switch between existing workflows or create a new workflow;
2. <code>Workflow name</code>: view or change the current workflow name;
3. <code>Canvas</code>: place nodes and connect them into a processing flow;
4. <code>Node list</code>: input, processing, review, and export nodes;
5. <code>Template</code>: start from a workflow template;
6. <code>Save</code>: save the current workflow.

### 5.3 Start from a template

Click <code>Template</code> in the upper-right corner and select a template that matches the received data.

[![Select a workflow template](../images/workflow-template-annotated.png)](../images/workflow-template-annotated.png)

1. <code>RGB-D_Workflow</code>: a processing chain for RGB and depth data;
2. <code>Stereo-RGB_Workflow</code>: a processing chain for left and right RGB data;
3. <code>Cancel</code>: close the dialog without applying a template.

A template can be applied to a new or existing workflow. Applying it replaces the processing chain on the current canvas but does not change the current workflow name.

A template contains processing steps only. Input device nodes are generated from the data actually received by the project. If the canvas contains unsaved changes, save them before applying another template.

### 5.4 Check a complete workflow

The following image shows a connected workflow.

[![Complete workflow](../images/workflow-editor-annotated.png)](../images/workflow-editor-annotated.png)

1. <code>Stereo RGB Camera</code>: left and right RGB videos received by the project;
2. <code>Glove Sensor</code>: glove sensor data received by the project;
3. <code>AI Annotation</code>: generate task text and annotation segments from RGB video;
4. <code>Human Review</code>: send video, sensor data, and annotations for manual review;
5. <code>LeRobot Export</code>: prepare the data for export using the workflow settings;
6. <code>Save</code>: save the workflow after checking its connections.

In this example, the video, glove data, and AI annotations all enter manual review:

    Stereo RGB Camera ─┬→ AI Annotation ─┐
                       └──────────────────
    Glove Sensor ─────────────────────────
                                        ↓
                                 Human Review
                                        ↓
                                 LeRobot Export

### 5.5 AI annotation settings

Open the settings dialog of the <code>AI Annotation</code> node to select the annotation language and API.

[![AI annotation settings](../images/workflow-ai-settings-annotated.png)](../images/workflow-ai-settings-annotated.png)

1. <code>Label Language</code>: choose Chinese or English annotations;
2. <code>Saved API Profile</code>: select a saved API profile;
3. <code>API Provider</code>: select the API provider;
4. <code>API Model</code>: enter or select the model;
5. <code>API Key</code>: enter the API key;
6. <code>API Base URL</code>: enter the API address. Leave it empty to use the provider's official default;
7. <code>Test Connection</code>: test whether the API is available before saving;
8. <code>Save</code>: save the AI annotation settings.

> API keys should appear masked. Do not share screenshots that reveal a complete API key.

### 5.6 Workflow module reference

The node list on the right is divided into <code>INPUT</code>, <code>PROCESS</code>, <code>REVIEW</code>, and <code>EXPORT</code>. Drag a node onto the canvas and connect its inputs and outputs.

#### INPUT: source data

| Module | Receives | Provides | When to use it |
| --- | --- | --- | --- |
| Glove Sensor | Glove pressure and joint data | Glove Sensor Data | When the project contains glove sensor data |
| RGB Camera | One color video | RGB Video | A monocular standard camera, monocular fisheye camera, or the color stream of an RGB-D camera |
| RGB-D Camera | Color video and a real depth stream | RGB Video, Depth | One RGB-D camera with depth data |
| Stereo RGB Camera | Left and right color videos | Left RGB Video, Right RGB Video | Stereo RGB video without a direct real-depth output |
| Stereo RGB-D Camera | Left and right color videos plus depth | Left RGB Video, Right RGB Video, Depth | Stereo video that also contains real depth |

#### PROCESS: processed data

| Module | Requires | Produces | Purpose |
| --- | --- | --- | --- |
| Human Annotation | RGB Video | Annotation | Manually create and edit task segments |
| AI Annotation | RGB Video | Annotation | Automatically generate Chinese or English annotations using a local model or API |
| RGB_TO_2D_BareHand | RGB Video | Hand 2D | Detect 2D keypoints in bare-hand video |
| RGB_TO_2D_BlackGlove | RGB Video | Hand 2D | Detect 2D keypoints in black-glove video |
| RGB-D_3D_BareHand | RGB Video + Depth | Hand 3D | Calculate real 3D bare-hand keypoints using matched depth data |
| RGB-D_3D_BlackGlove | RGB Video + Depth | Hand 3D | Calculate real 3D black-glove keypoints using matched depth data |

The <code>RGB_TO_2D</code> modules produce two-dimensional keypoints. Their spatial preview is for viewing only and is not exported as real metric 3D data.

#### REVIEW: inspect data

| Module | Purpose | Result |
| --- | --- | --- |
| Human Review | Let a user play the video and inspect keypoints, depth, sensor data, and annotations | Output Reviewed Data after approval |
| AI Quality Review | Automatically check decoding, frame continuity, black or frozen frames, and AI annotation coverage | Output Reviewed Data after passing; send abnormal data for manual handling |

#### EXPORT: export data

| Module | Purpose | Main settings |
| --- | --- | --- |
| LeRobot Export | Export a LeRobot dataset | Select v2.1 or v3.0; includes the corresponding meta, data, and videos |
| HDF5 Export | Export one HDF5 data file | Save with gzip compression |

Connect an export module after a review module so that only inspected and approved data enters the export flow.

### 5.7 Common workflow examples

Standard RGB:

    RGB β†’ Hand 2D β†’ Human Review β†’ Export

RGB and depth:

    RGB + Depth β†’ Hand 3D β†’ Human Review β†’ Export

RGB and glove sensor:

    RGB + Glove Sensor β†’ Human Review β†’ Export

### 5.8 Important rules

- Both RGB and Depth are required to calculate real 3D.
- RGB alone can produce 2D keypoints.
- A spatial preview produced from RGB alone is not real metric 3D.
- A step is skipped when its required input does not match the Episode.

<code>Input mismatch</code> means the workflow requires different data from the current project. Select a matching workflow.

## 6. Data annotation

### 6.1 Select data to annotate

Click <code>Annotation</code> in the left navigation. Expand a project on the right, then select an Episode.

[![Annotation data list](../images/annotation-list-annotated.png)](../images/annotation-list-annotated.png)

1. <code>Annotation</code>: open the Annotation page;
2. Click a project name to expand it;
3. Click an Episode number to load its video and existing annotations.

If the center shows <code>Select an episode to review</code>, no Episode has been selected. This is not a system failure.

### 6.2 View and edit annotations

[![Annotation editor](../images/annotation-editor-annotated.png)](../images/annotation-editor-annotated.png)

1. <code>Preview Options</code>: show or hide keypoints, trails, depth, and 3D previews;
2. <code>RGB and 2D keypoints</code>: view the original image and 2D hand keypoints;
3. <code>3D hand space</code>: view hand keypoints in space;
4. <code>Depth pseudo-color preview</code>: view depth data in the browser;
5. <code>AI Annotate</code>: run AI annotation using the workflow settings;
6. <code>Annotation segment</code>: click a segment on the right to view or edit it;
7. <code>Set Start / Set End</code>: use the current frame as the segment's start or end frame;
8. <code>Save Changes</code>: save changes to the segment name and frame range.

### 6.3 Manually edit an annotation

1. Click the annotation segment that needs editing.
2. Check its start frame, end frame, and task name.
3. Make the changes and click <code>Save Changes</code>.
4. Check the annotation block on the timeline at the bottom.

### 6.4 AI annotation

1. Confirm that <code>AI Annotation</code> is configured in the workflow.
2. Select Chinese or English in the workflow settings.
3. Click <code>AI Annotate</code>.
4. Wait for the annotation segments to be generated.
5. Manually inspect the result and correct any errors.
6. If the workflow contains this feature, AI annotation runs automatically during workflow processing.
7. Network fluctuations may occasionally leave a short segment without annotation information.

## 7. Video viewing and review

### 7.1 Select data awaiting review

Click <code>Reviewing</code> under <code>Video Review</code>, then select an Episode from the right panel.

[![Reviewing list](../images/reviewing-list-annotated.png)](../images/reviewing-list-annotated.png)

1. <code>Reviewing</code>: view data waiting for manual review;
2. <code>Expand project</code>: view the Episodes in a project;
3. <code>Select Episode</code>: open the data and view its FPS, frame count, cameras, and processing status;
4. <code>Approve</code>: approve the current Episode after checking it;
5. <code>Reprocess</code>: run the workflow bound to the project again when the result is incorrect.

### 7.2 Inspect video and processing results

[![Video review](../images/reviewing-player-annotated.png)](../images/reviewing-player-annotated.png)

1. <code>Preview Options</code>: show or hide different preview layers;
2. <code>RGB image</code>: view the color video. When keypoint display is enabled, 2D hand keypoints are overlaid;
3. <code>3D hand space</code>: inspect hand keypoints in space;
4. <code>Depth pseudo-color preview</code>: check whether the depth data looks normal;
5. <code>Read-only annotation segments</code>: inspect task names and frame ranges;
6. <code>Playback and frame controls</code>: play the video or inspect details with the previous-frame and next-frame buttons;
7. <code>Approve</code>: approve the current Episode.

Wait for the related data to finish loading before playback. RGB, 2D, 3D, depth, and sensor views should display the same frame number.

### 7.3 About the depth view

Blue, green, yellow, and other colors in the depth view are only a browser preview.

The depth video stores raw 12-bit depth codes. The pseudo-color image is not written back to the original data.

### 7.4 Common display problems

- Black screen: wait for the current Episode to load, then refresh the page.
- No 3D hand: check whether the workflow includes 3D processing and whether the Episode contains Depth.
- Keypoints do not move: reprocess that Episode.
- Playback stutters: wait until the related data has been cached before playing.

## 8. Approved data and export

### 8.1 Approved data

Click <code>Approved</code> under <code>Video Review</code> to view data that has passed review.

[![Approved data and export](../images/approved-list-annotated.png)](../images/approved-list-annotated.png)

1. <code>Approved</code>: open the Approved list;
2. <code>Multi-select mode</code>: click <code>Select</code> at the top of the page. The button changes to <code>Cancel</code> while this mode is active;
3. <code>Select All</code>: select every Episode in the current list;
4. <code>Episode checkbox</code>: select one Episode or multiple Episodes;
5. <code>Export</code>: export this single Episode;
6. <code>Unreview</code>: remove approval and return the Episode to the Reviewing list.

### 8.2 Export process

Export one Episode:

1. Click <code>Export</code> on that Episode's card.
2. Wait for the export to finish and download the archive.

Batch export:

1. Click <code>Select</code> at the top of the page.
2. Select one or more Episodes, or click <code>Select All</code>.
3. A <code>Batch Download</code> action bar appears after Episodes are selected.
4. Click <code>Batch Download</code> and wait for the export to finish.

The export format comes from the current workflow's export node, such as LeRobot 2.1, LeRobot 3.0, or HDF5. No separate export page is required.

### 8.3 Exported content

    Project name/
    β”œβ”€β”€ meta/       # Descriptions and statistics
    β”œβ”€β”€ data/       # Per-frame data, keypoints, and sensor data
    └── videos/     # Videos

Processed keypoints, annotations, and glove sensor data are exported together with the corresponding source data.

## 9. Failed data

### 9.1 Handling process

    See Failed
      ↓
    Open the failed data
      ↓
    Read the error message
      ↓
    Click Retry or Reprocess
      ↓
    Wait for processing

> Screenshot to be added: Failed page.

### 9.2 Common errors

| Error | What to do |
| --- | --- |
| No RGB | Check whether a color video was uploaded |
| No Depth | Real 3D cannot be calculated |
| Workflow mismatch | Select a matching workflow |
| AI annotation failed | Check the API settings and retry |
| Video cannot be opened | Send it again from the collector or contact the administrator |
| Worker is not running | Ask the administrator to restart the service |

If processing still fails after two retries, provide the data name, an error screenshot, the time of failure, and the steps that caused it.

## 10. Trash

### 10.1 What is Trash for?

Deleted data first enters Trash.

### 10.2 How to use it

[![Trash](../images/trash-annotated.png)](../images/trash-annotated.png)

1. Click <code>Trash</code> in the left navigation;
2. Check the remaining retention time;
3. Click <code>Restore</code> if the data should be kept;
4. Click <code>Delete</code> only when the data can be permanently removed;
5. <code>Purge All</code> permanently deletes everything in Trash.

### 10.3 Important notes

- Data in Trash can be restored.
- Permanently deleted data usually cannot be recovered.
- Confirm again before emptying Trash.
- If data cannot be found, first check its project name and deletion time.

## 11. Frequently asked questions

### The page does not open

Check whether the service is running.

### Data remains in Processing

Refresh the page. If the status does not change for a long time, the Worker may not be running.

### The depth view is black

Wait for loading to finish, refresh the page, and confirm that the current Episode really contains a depth video.

### There is 2D but no 3D

Real 3D requires both RGB and Depth. RGB alone cannot calculate real spatial positions.

### Playback stutters

Wait for loading to finish before playing. Use the previous-frame and next-frame buttons when checking details.

### AI annotation has no result

Check the API settings, model, network, and language, then run AI annotation again.

### Export fails

Confirm that the data has passed review, then export it again.

## 12. Data and program information

### 12.1 Project directory

    processor/
    β”œβ”€β”€ app/        # Backend, workflow, video, and export
    β”œβ”€β”€ worker/     # Background processing tasks
    β”œβ”€β”€ web/        # Pages and frontend code
    β”œβ”€β”€ scripts/    # Startup, inspection, and maintenance scripts
    β”œβ”€β”€ tests/      # Automated tests
    β”œβ”€β”€ deploy.py   # One-command deployment entry point
    └── .env        # Local configuration; do not commit to Git

### 12.2 Project data directory

    data/sessions/<project>/
    β”œβ”€β”€ data/
    β”œβ”€β”€ meta/
    └── videos/

Raw depth videos store depth codes. The browser's pseudo-color preview is not written back to the original data.

### 12.3 Startup checks

    python deploy.py --check-only
    python -m compileall app worker
    PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q

Do not commit <code>.env</code>, API keys, tokens, real data, or server credentials to Git.

## 13. Code structure and responsibilities

This chapter explains the frontend, backend, Worker, and data-processing code behind the pages. Normal operation does not require changing these files. When maintaining a feature, use this chapter to find the corresponding code quickly.

### 13.1 System code flow

    Browser page
        ↓
    HTML templates and JavaScript
        ↓
    FastAPI backend APIs
        ↓
    Projects, Episodes, annotations, and workflows
        ↓
    Worker claims a processing job
        ↓
    Workflow modules run post-processing
        ↓
    Save keypoints, 3D, sensor, and annotation results
        ↓
    Video review and data export

Business data is primarily stored in project files. User accounts can use a database. The application retains a compatibility fallback when the database is temporarily unavailable.

### 13.2 Code directory tree

    processor/
    β”œβ”€β”€ app/                         # Python backend
    β”‚   β”œβ”€β”€ main.py                  # FastAPI application entry point
    β”‚   β”œβ”€β”€ config.py                # Environment variables and system settings
    β”‚   β”œβ”€β”€ paths.py                 # Shared directory paths
    β”‚   β”œβ”€β”€ localstore.py            # Project, workflow, and Episode file state
    β”‚   β”œβ”€β”€ database.py              # User account database connection
    β”‚   β”œβ”€β”€ models.py                # Database models
    β”‚   β”œβ”€β”€ workflow_dispatch.py     # Workflow matching, dispatch, and backfill
    β”‚   β”œβ”€β”€ workflow_bindings.py     # Bind workflows to actual device inputs
    β”‚   β”œβ”€β”€ ai_annotation.py         # AI annotation service
    β”‚   β”œβ”€β”€ export_engine.py         # Shared export-job logic
    β”‚   β”œβ”€β”€ lerobot_export.py        # LeRobot 3.0 dataset generation
    β”‚   β”œβ”€β”€ lerobot_v21.py           # LeRobot 2.1 compatibility
    β”‚   β”œβ”€β”€ hdf5_export.py           # HDF5 dataset generation
    β”‚   β”œβ”€β”€ routes/                  # Page and business APIs
    β”‚   β”œβ”€β”€ api/                     # Project, workflow, and Worker APIs
    β”‚   └── processing/              # Workflow processing framework
    β”‚       β”œβ”€β”€ registry.py           # Automatic module registration
    β”‚       β”œβ”€β”€ catalog.py            # Module catalog for the workflow page
    β”‚       β”œβ”€β”€ batch.py              # Find videos and Parquet files in a batch
    β”‚       └── modules/              # Execution code for workflow nodes
    β”œβ”€β”€ worker/                      # Background processing program
    β”‚   β”œβ”€β”€ __main__.py              # Worker entry point
    β”‚   β”œβ”€β”€ runner.py                # Claim and execute workflow jobs
    β”‚   └── client.py                # Communicate with the backend Worker API
    β”œβ”€β”€ web/                         # Frontend pages
    β”‚   β”œβ”€β”€ templates/               # HTML page templates
    β”‚   β”œβ”€β”€ static/js/               # Page interaction, playback, and rendering
    β”‚   └── workflow-studio/         # React workflow editor source
    β”œβ”€β”€ scripts/                     # Deployment, migration, and maintenance
    β”œβ”€β”€ tests/                       # Automated tests
    β”œβ”€β”€ models/                      # Local model files
    β”œβ”€β”€ docs/                        # Chinese and English documentation
    β”œβ”€β”€ deploy.py                    # One-command deployment entry point
    └── requirements*.txt            # Python dependencies

<code>.venv*</code>, <code>.pytest_cache</code>, and <code>.backups</code> are local environments, test caches, or backups. They are not part of the main business code.

### 13.3 Frontend code

The frontend has two parts:

1. Standard pages use HTML templates and plain JavaScript.
2. The workflow editor uses React and TypeScript.

#### Page templates

| File | Responsibility |
| --- | --- |
| <code>web/templates/base.html</code> | Common page frame, left navigation, and shared resources |
| <code>web/templates/overview.html</code> | Home page |
| <code>web/templates/tasks.html</code> | Project management page |
| <code>web/templates/index.html</code> | Annotation and video-review pages |
| <code>web/templates/trash.html</code> | Trash page |
| <code>web/templates/login.html</code> | Login page |
| <code>web/templates/users.html</code> | User management page, still under development |
| <code>web/templates/workflow_studio.html</code> | Workflow editor entry page |

#### Page JavaScript

| File | Responsibility |
| --- | --- |
| <code>web/static/js/dashboard.js</code> | Home statistics, recent data, and refresh |
| <code>web/static/js/tasks.js</code> | Create, edit, delete, and expand projects and batches |
| <code>web/static/js/app.js</code> | Episode list, review, deletion, and export actions |
| <code>web/static/js/player.js</code> | Video loading, central playback clock, and frame synchronization |
| <code>web/static/js/annotations.js</code> | Annotation segments, timeline, and frame-level annotation |
| <code>web/static/js/slice-preview.js</code> | Annotation segment preview in the upper-right corner |
| <code>web/static/js/hand-overlay.js</code> | Draw 2D hand keypoints over the RGB video |
| <code>web/static/js/depth-renderer.js</code> | Render raw 12-bit depth codes as browser pseudo-color |
| <code>web/static/js/heatmap.js</code> | Display glove sensor data in sync with video |
| <code>web/static/js/media-cache.js</code> | Cache keypoints and sensor data in IndexedDB |
| <code>web/static/js/i18n.js</code> | Chinese and English interface text |
| <code>web/static/js/login.js</code> | Login form |
| <code>web/static/js/users.js</code> | User management interactions, still under development |

The workflow editor source is in <code>web/workflow-studio/src/</code>. Its compiled files are in <code>web/static/workflow-studio/</code>. Change the source and rebuild the editor; do not edit the compiled output directly.

### 13.4 Backend entry point and page APIs

<code>app/main.py</code> is the backend entry point. It is responsible for:

- Starting FastAPI;
- Initializing file directories and the user database;
- Warming project and Episode metadata caches;
- Starting the upload processing queue;
- Registering page, project, video, annotation, workflow, and export APIs;
- Configuring static-file caching and large-media transfer behavior.

| File | Responsibility |
| --- | --- |
| <code>app/routes/pages.py</code> | Return the Home, Projects, Review, Workflow, and Trash pages |
| <code>app/routes/dashboard.py</code> | Home statistics, recent Episodes, and trends |
| <code>app/routes/session.py</code> | Receive archives, extract files, normalize directories, and import metadata |
| <code>app/routes/ingestion.py</code> | Episode list, details, approval, reprocessing, deletion, and restoration |
| <code>app/routes/video.py</code> | RGB video, depth code, depth preview, 2D, 3D, and sensor APIs |
| <code>app/routes/annotations.py</code> | Create, edit, delete, and read per-frame annotations |
| <code>app/routes/export.py</code> | Single export, batch export, export status, and downloads |
| <code>app/routes/auth.py</code> | Login, logout, and current-user APIs |
| <code>app/routes/devices.py</code> | Collector heartbeat and input capabilities |

### 13.5 Project, workflow, and Worker APIs

| File | Responsibility |
| --- | --- |
| <code>app/api/projects.py</code> | Create, edit, and delete projects; manage inputs and workflow bindings |
| <code>app/api/workflows.py</code> | Create, save, run, inspect usage, and retry workflows |
| <code>app/api/worker.py</code> | Claim jobs, download inputs, send heartbeats, and report completion or failure |
| <code>app/api/exceptions.py</code> | Aggregate and clear processing exceptions |
| <code>app/api/users.py</code> | Create users and manage roles, statuses, and deletion; still under development |

The backend and Worker job flow is:

    Backend creates a workflow run
        ↓
    Worker claims the job
        ↓
    Worker downloads the Episode input
        ↓
    Workflow nodes execute
        ↓
    Worker uploads the result and reports completion
        ↓
    Episode enters Reviewing or Approved

The Worker sends regular heartbeats. If it stops, the job is not immediately lost; the backend can schedule it again after the lease expires.

### 13.6 Workflow processing modules

In <code>app/processing/modules/</code>, one Python file usually represents one workflow node. Modules are registered automatically, displayed in the workflow editor, and executed by the Worker.

| Module file | Responsibility |
| --- | --- |
| <code>mono_camera.py</code> | Single RGB input |
| <code>rgbd_camera.py</code> | RGB and depth input |
| <code>stereo_camera.py</code> | Left and right stereo RGB input |
| <code>stereo_rgbd_camera.py</code> | Left and right RGB plus depth input |
| <code>glove_sensor.py</code> | Glove sensor input |
| <code>mediapipe_hand.py</code> | MediaPipe hand keypoint and gesture recognition |
| <code>rgb_hand_3d.py</code> | Bare-hand RGB 2D keypoints and spatial preview |
| <code>black_hand_rgb_3d.py</code> | Black-glove RGB 2D keypoints and spatial preview |
| <code>depth_hand_3d.py</code> | Real 3D calculation helper used by RGB-D hand modules; not a standalone node |
| <code>black_glove_hand.py</code> | Black-glove keypoint processing |
| <code>ai_annotation.py</code> | Declare and trigger automatic AI annotation |
| <code>annotation.py</code> | Human annotation workflow node |
| <code>human_review.py</code> | Human-review gate |
| <code>ai_quality_review.py</code> | Automatic video and annotation quality checks |
| <code>lerobot_export.py</code> | LeRobot export node |
| <code>hdf5_export.py</code> | HDF5 export node |

When adding a workflow module, check:

1. The module input and output types;
2. Whether the Worker can execute it;
3. Whether the workflow editor displays it correctly;
4. Whether the Review page can read its output;
5. Whether export modules include the new output.

### 13.7 Data, cache, and export code

| File | Responsibility |
| --- | --- |
| <code>app/localstore.py</code> | Scan and cache projects, Episodes, workflows, and run states |
| <code>app/storage.py</code> | Upload, validate, save, and remotely synchronize files |
| <code>app/remote_storage.py</code> | Remote storage access |
| <code>app/media_groups.py</code> | Organize RGB, depth, and sensor media groups |
| <code>app/media_cache.py</code> | Server-side media cache |
| <code>app/browser_preview.py</code> | Generate browser-compatible video previews |
| <code>app/artifact_resolver.py</code> | Locate workflow processing results |
| <code>app/export_engine.py</code> | Shared export flow |
| <code>app/lerobot_export.py</code> | Generate LeRobot 3.0 datasets |
| <code>app/lerobot_v21.py</code> | Generate and support LeRobot 2.1 data |
| <code>app/hdf5_export.py</code> | Generate HDF5 datasets |

Keep source data, processing results, and export copies distinct:

    data/sessions/     # Project source data and merged processing fields
    data/tmp/          # Temporary processing files
    Browser IndexedDB # Frontend preview cache; can be regenerated
    Export archives   # Delivery files generated from workflow settings

Do not store the browser's pseudo-color depth images as source data. The source depth remains raw depth codes.

### 13.8 Where to change a feature

| Feature | Frontend | Backend or processing |
| --- | --- | --- |
| Home statistics | <code>dashboard.js</code> | <code>routes/dashboard.py</code> |
| Projects page | <code>tasks.js</code> | <code>api/projects.py</code> |
| Upload and extraction | Projects page | <code>routes/session.py</code> |
| Workflow editor | <code>workflow-studio/src/</code> | <code>api/workflows.py</code> |
| Automatic workflow run | Project status display | <code>workflow_dispatch.py</code> |
| RGB video playback | <code>player.js</code> | <code>routes/video.py</code> |
| Playback frame synchronization | <code>player.js</code> | <code>routes/video.py</code> |
| 2D hand keypoints | <code>hand-overlay.js</code> | Hand-processing modules |
| 3D hand space | <code>player.js</code> | <code>processing/modules/*3d*.py</code> |
| Depth pseudo-color | <code>depth-renderer.js</code> | <code>routes/video.py</code> |
| Glove sensor | <code>heatmap.js</code> | <code>glove_sensor.py</code> |
| Annotation timeline | <code>annotations.js</code> | <code>routes/annotations.py</code> |
| AI annotation | <code>annotations.js</code> | <code>ai_annotation.py</code> |
| Video review | <code>app.js</code> | <code>routes/ingestion.py</code> |
| Single and batch export | <code>app.js</code> | <code>routes/export.py</code> |
| LeRobot format | Export button | <code>lerobot_export.py</code>, <code>lerobot_v21.py</code> |
| HDF5 format | Export button | <code>hdf5_export.py</code> |
| Trash | <code>trash.html</code> | <code>routes/ingestion.py</code> |
| User management | <code>users.js</code> | <code>api/users.py</code> |

### 13.9 Troubleshooting order

When a problem occurs, check it in this order:

1. Confirm which page shows the problem.
2. Find the JavaScript file used by that page.
3. Check the browser developer tools for failed API requests.
4. Use the API address to find the corresponding Python route.
5. If it is a workflow job, inspect the Worker and processing module.
6. If displays are out of sync, inspect the current Episode's frame count, FPS, and cache.
7. Run the tests after making changes, then validate with real data.

## Closing note

Receive the data first, process it next, inspect it after processing, and export it only after it passes review.