hudini 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. hudini-0.1.0/.github/timeline.png +0 -0
  2. hudini-0.1.0/.github/workflows/release.yml +18 -0
  3. hudini-0.1.0/.gitignore +7 -0
  4. hudini-0.1.0/.python-version +1 -0
  5. hudini-0.1.0/LICENSE +202 -0
  6. hudini-0.1.0/PKG-INFO +293 -0
  7. hudini-0.1.0/README.md +258 -0
  8. hudini-0.1.0/pyproject.toml +78 -0
  9. hudini-0.1.0/src/hudini/__init__.py +1 -0
  10. hudini-0.1.0/src/hudini/archive.py +414 -0
  11. hudini-0.1.0/src/hudini/assets/pods.json +266 -0
  12. hudini-0.1.0/src/hudini/assets/sensitive_popups.json +9 -0
  13. hudini-0.1.0/src/hudini/catalog.py +294 -0
  14. hudini-0.1.0/src/hudini/cli.py +689 -0
  15. hudini-0.1.0/src/hudini/cnn.py +310 -0
  16. hudini-0.1.0/src/hudini/corrections.py +421 -0
  17. hudini-0.1.0/src/hudini/detection.py +185 -0
  18. hudini-0.1.0/src/hudini/hsv.py +190 -0
  19. hudini-0.1.0/src/hudini/layout.py +233 -0
  20. hudini-0.1.0/src/hudini/ocr.py +164 -0
  21. hudini-0.1.0/src/hudini/parser.py +354 -0
  22. hudini-0.1.0/src/hudini/privacy.py +336 -0
  23. hudini-0.1.0/src/hudini/schema.py +493 -0
  24. hudini-0.1.0/src/hudini/sensors.py +949 -0
  25. hudini-0.1.0/src/hudini/session.py +274 -0
  26. hudini-0.1.0/src/hudini/storage.py +338 -0
  27. hudini-0.1.0/src/hudini/video.py +116 -0
  28. hudini-0.1.0/src/hudini/views.py +946 -0
  29. hudini-0.1.0/src/hudini/web/__init__.py +1 -0
  30. hudini-0.1.0/src/hudini/web/render.py +56 -0
  31. hudini-0.1.0/src/hudini/web/server.py +244 -0
  32. hudini-0.1.0/src/hudini/web/static/app.css +373 -0
  33. hudini-0.1.0/src/hudini/web/static/app.html +19 -0
  34. hudini-0.1.0/src/hudini/web/static/app.js +33 -0
  35. hudini-0.1.0/src/hudini/web/static/data.js +67 -0
  36. hudini-0.1.0/src/hudini/web/static/favicon.svg +37 -0
  37. hudini-0.1.0/src/hudini/web/static/shared.js +179 -0
  38. hudini-0.1.0/src/hudini/web/static/view_index.js +471 -0
  39. hudini-0.1.0/src/hudini/web/static/view_timeline.js +1086 -0
  40. hudini-0.1.0/tests/__init__.py +0 -0
  41. hudini-0.1.0/tests/conftest.py +8 -0
  42. hudini-0.1.0/tests/test_archive.py +428 -0
  43. hudini-0.1.0/tests/test_catalog.py +215 -0
  44. hudini-0.1.0/tests/test_cli.py +476 -0
  45. hudini-0.1.0/tests/test_cnn.py +125 -0
  46. hudini-0.1.0/tests/test_corrections.py +405 -0
  47. hudini-0.1.0/tests/test_detection.py +165 -0
  48. hudini-0.1.0/tests/test_hsv.py +121 -0
  49. hudini-0.1.0/tests/test_import_hygiene.py +33 -0
  50. hudini-0.1.0/tests/test_layout.py +127 -0
  51. hudini-0.1.0/tests/test_ocr.py +84 -0
  52. hudini-0.1.0/tests/test_parser.py +216 -0
  53. hudini-0.1.0/tests/test_privacy.py +282 -0
  54. hudini-0.1.0/tests/test_repo_hygiene.py +38 -0
  55. hudini-0.1.0/tests/test_schema.py +277 -0
  56. hudini-0.1.0/tests/test_sensors.py +484 -0
  57. hudini-0.1.0/tests/test_session.py +363 -0
  58. hudini-0.1.0/tests/test_storage.py +307 -0
  59. hudini-0.1.0/tests/test_video.py +192 -0
  60. hudini-0.1.0/tests/test_views.py +955 -0
  61. hudini-0.1.0/tests/test_web_render.py +57 -0
  62. hudini-0.1.0/tests/test_web_server.py +252 -0
  63. hudini-0.1.0/tools/opencv-contrib-python-stub/pyproject.toml +11 -0
  64. hudini-0.1.0/uv.lock +3483 -0
Binary file
@@ -0,0 +1,18 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ pypi:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v5
17
+ - run: uv build
18
+ - run: uv publish
@@ -0,0 +1,7 @@
1
+ .export-target
2
+ .venv/
3
+ dist/
4
+ __pycache__/
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .hypothesis/
@@ -0,0 +1 @@
1
+ 3.12
hudini-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Claas de Boer
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
hudini-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,293 @@
1
+ Metadata-Version: 2.5
2
+ Name: hudini
3
+ Version: 0.1.0
4
+ Summary: A UI/HUD parser for the da Vinci Xi.
5
+ Project-URL: Repository, https://github.com/claasdeboer/hudini
6
+ Project-URL: Models, https://huggingface.co/nct-tso/hudini
7
+ Project-URL: Annotations, https://huggingface.co/datasets/nct-tso/hudini-annotations
8
+ Author-email: Claas de Boer <claas.deboer@nct-dresden.de>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Requires-Python: >=3.12
12
+ Requires-Dist: av>=12.0.0
13
+ Requires-Dist: huggingface-hub>=1.0
14
+ Requires-Dist: msgspec>=0.19.0
15
+ Requires-Dist: numpy>=1.24.0
16
+ Requires-Dist: opencv-python-headless>=4.13.0.0
17
+ Requires-Dist: paddleocr>=3.7.0
18
+ Requires-Dist: pillow>=12.1.0
19
+ Requires-Dist: rapidfuzz>=3.14.3
20
+ Requires-Dist: timm>=1.0.0
21
+ Requires-Dist: torch>=2.0.0
22
+ Requires-Dist: torchvision>=0.25.0
23
+ Requires-Dist: tqdm>=4.0.0
24
+ Requires-Dist: transformers>=5.12.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: hypothesis>=6.100; extra == 'dev'
27
+ Requires-Dist: opencv-contrib-python; extra == 'dev'
28
+ Requires-Dist: pytest>=9.1.1; extra == 'dev'
29
+ Requires-Dist: ruff>=0.16.0; extra == 'dev'
30
+ Requires-Dist: ty>=0.0.1a21; extra == 'dev'
31
+ Provides-Extra: rfdetr
32
+ Requires-Dist: rfdetr>=1.0; extra == 'rfdetr'
33
+ Requires-Dist: supervision>=0.28; extra == 'rfdetr'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # hudini
37
+
38
+ [![PyPI](https://img.shields.io/pypi/v/hudini?color=2a78d6)](https://pypi.org/project/hudini/)
39
+ [![License](https://img.shields.io/badge/license-Apache--2.0-2a78d6)](https://github.com/claasdeboer/hudini/blob/main/LICENSE)
40
+ [![Checkpoints](https://img.shields.io/badge/%F0%9F%A4%97%20checkpoints-nct--tso%2Fhudini-ffd21e)](https://huggingface.co/nct-tso/hudini)
41
+ [![Annotations](https://img.shields.io/badge/%F0%9F%A4%97%20annotations-nct--tso%2Fhudini--annotations-ffd21e)](https://huggingface.co/datasets/nct-tso/hudini-annotations)
42
+
43
+ A UI/HUD parser for the da Vinci Xi.
44
+
45
+ The da Vinci Xi draws part of its system state into the surgical
46
+ video through its user interface: the instrument on each arm, the arms under surgeon control, each
47
+ energy pedal press, and the instruments outside the view. hudini reads
48
+ this display and turns the pixels back into a log of events with
49
+ timestamps. You do not need the robot logs.
50
+
51
+ With this log you can, for example:
52
+
53
+ - find moments of interest in a video archive, such as stapler firings
54
+ or energy activations
55
+ - label video for machine learning with instrument presence and arm
56
+ activity, with no manual annotation
57
+ - describe a case by its events: the instruments used, the time each
58
+ arm was under surgeon control, the number of pedal presses
59
+ - find the popups that show the surgeon's account name before you
60
+ share a recording
61
+
62
+ > [!NOTE]
63
+ > hudini recovers only the state that the heads-up display shows. A
64
+ > recording without the display contains nothing it can read, and it
65
+ > does not infer the robot state from the surgical scene. The display
66
+ > can lag the device by the rendering latency of the interface. The
67
+ > instrument catalogs used for fuzzy matching cover the English and German system locales.
68
+
69
+ ![The instrument timeline of one SurgVU video, recovered by hudini](https://raw.githubusercontent.com/claasdeboer/hudini/main/.github/timeline.png)
70
+
71
+ *The instrument timeline of one SurgVU video, recovered by hudini. Each
72
+ row is one arm. The color shows the instrument class. Saturated color
73
+ marks the time under surgeon control. Ticks mark pedal presses.*
74
+
75
+ ## Quick start
76
+
77
+ ```bash
78
+ uv tool install "hudini[rfdetr] @ git+https://github.com/claasdeboer/hudini"
79
+ hudini fetch # download the model checkpoints once
80
+ hudini parse video.mp4 # -> ./video.hudini.jsonl.gz
81
+ hudini timeline video.hudini.jsonl.gz # -> ./video.html
82
+ ```
83
+
84
+ `hudini parse` writes one compressed observation log. `hudini timeline`
85
+ turns this log into a self-contained HTML page. Open the page in a
86
+ browser. If the video is in the same folder, the page plays it at the
87
+ selected time.
88
+
89
+ A PyPI release will follow. Until then, install from GitHub. See
90
+ [Installation](#installation) for the details.
91
+
92
+ ## Try it without your own data
93
+
94
+ The `Surgical/utenn` subset of
95
+ [PhysicalAI-Robotics-Open-H-Embodiment](https://huggingface.co/datasets/nvidia/PhysicalAI-Robotics-Open-H-Embodiment)
96
+ (NVIDIA, CC-BY-4.0) contains short da Vinci Xi clips with the display
97
+ in the frame. One of them is enough to see hudini work:
98
+
99
+ ```bash
100
+ curl -LO https://huggingface.co/datasets/nvidia/PhysicalAI-Robotics-Open-H-Embodiment/resolve/main/Surgical/utenn/surgical_video_datasets/videos/chunk-000/observation.images.color/episode_000009.mp4
101
+ hudini parse episode_000009.mp4
102
+ hudini timeline episode_000009.hudini.jsonl.gz
103
+ ```
104
+
105
+ Episode 009 contains two pedal presses. In the timeline, they appear as
106
+ two ticks above the row of arm 3, at about 6 and 9 seconds.
107
+
108
+ ## What hudini extracts
109
+
110
+ | Signal | Output | Method |
111
+ |---|---|---|
112
+ | `status` | arm status: under surgeon control, inactive, or warning | color rule, CNN for the endoscope pod |
113
+ | `arm` | the arm digit, 1 to 4 | CNN |
114
+ | `instrument` | the mounted instrument, matched to the catalog | OCR, catalog match |
115
+ | `pedals` | yellow and blue pedal presses | color rule |
116
+ | `pedal_label` | the action of a press (CUT, COAG, ...) | catalog, OCR when necessary |
117
+ | `laser` | the Firefly laser readout | color rule |
118
+ | `popups`, `banner` | the message text of each column, the system banner | OCR |
119
+ | `offscreen` | off-screen indicator bars, with state and arm | RF-DETR, CNN |
120
+ | `tool_association` | tool-association badges, with arm | RF-DETR |
121
+
122
+ Every observation carries a timestamp and a confidence score. The
123
+ layout, the popups, and the detected indicators also carry their
124
+ bounding boxes in the frame.
125
+
126
+ ## Output
127
+
128
+ A parse writes one file, the observation log `<video>.hudini.jsonl.gz`.
129
+ Everything else is a view of this log, computed when you read it:
130
+
131
+ - **timeline**: a self-contained HTML page with the video and the
132
+ intervals of each arm (`hudini timeline`)
133
+ - **frame view**: the state at each sampled frame, for comparison with
134
+ frame-level labels (`hudini timeline --frames`). The rate of the
135
+ layout signal decides which frames are sampled.
136
+ - **interval view**: the runs of each lane, for example instrument
137
+ presence and time under surgeon control (the data that the timeline
138
+ shows)
139
+
140
+ The views apply the correction rules of the run as patches on top of
141
+ the log. The log itself never changes. To print the state at one
142
+ moment:
143
+
144
+ ```bash
145
+ hudini query video.hudini.jsonl.gz --at 98:23
146
+ ```
147
+
148
+ ### Log format
149
+
150
+ The log stores observations, not one complete record for each frame.
151
+ Each line records one reading of one signal:
152
+
153
+ ```json
154
+ {
155
+ "t": 98.4,
156
+ "f": 2952,
157
+ "s": "pedals",
158
+ "k": [2, "blue"],
159
+ "v": {"type": "press", "pressed": true},
160
+ "c": 0.99
161
+ }
162
+ ```
163
+
164
+ | Field | Meaning |
165
+ |---|---|
166
+ | `t` | video time in seconds |
167
+ | `f` | frame index |
168
+ | `s` | signal |
169
+ | `k` | key of the reading, here arm 2 and the blue pedal |
170
+ | `v` | value, `null` clears the key |
171
+ | `c` | confidence |
172
+
173
+ The first line is the header with the run configuration, and the last
174
+ line is the footer. The file is gzip JSONL, one object per line, so any
175
+ JSON lines tool can read it:
176
+
177
+ ```bash
178
+ zcat video.hudini.jsonl.gz | head -1 | jq .signals
179
+ zcat video.hudini.jsonl.gz | grep '"s":"pedals"' | head -3
180
+ ```
181
+
182
+ ## Screening recordings for identifying information
183
+
184
+ When a user applies an energy preset, the Xi shows a popup with that
185
+ user's account name. If this is the real name of the surgeon, the
186
+ recording identifies the surgeon. `hudini screen` finds these popups in
187
+ a video or in a stored log. It reports each episode with the bounding
188
+ box of the popup, so you can redact the popup and keep the rest of the
189
+ frame.
190
+
191
+ ```bash
192
+ hudini screen video.mp4
193
+ hudini screen video.hudini.jsonl.gz --json
194
+ ```
195
+
196
+ ## Installation
197
+
198
+ hudini needs Python 3.12 or newer. A GPU makes parsing faster.
199
+
200
+ ```bash
201
+ uv tool install "hudini[rfdetr] @ git+https://github.com/claasdeboer/hudini"
202
+ ```
203
+
204
+ The `[rfdetr]` extra installs the two indicator detectors. Without it,
205
+ hudini reads every signal except `offscreen` and `tool_association`.
206
+ Skip the extra if you do not need these two signals.
207
+
208
+ The model weights are not in the package. hudini downloads them from
209
+ [nct-tso/hudini](https://huggingface.co/nct-tso/hudini) at a pinned
210
+ revision on first use. To download them in advance:
211
+
212
+ ```bash
213
+ hudini fetch
214
+ ```
215
+
216
+ <details>
217
+ <summary>OpenCV dependency note</summary>
218
+
219
+ `paddleocr` pins `opencv-contrib-python==4.10`. This pin installs a
220
+ second `cv2` next to `opencv-python-headless`. This is an upstream
221
+ issue in `paddlex`. The parser runs with both installed.
222
+
223
+ </details>
224
+
225
+ ## Commands
226
+
227
+ | Command | Description |
228
+ |---|---|
229
+ | `hudini parse video.mp4` | parse a video into its observation log |
230
+ | `hudini timeline log` | build a self-contained HTML timeline (`--frames` also writes the per-frame export) |
231
+ | `hudini query log --at 98:23` | print the state at one moment, as JSON |
232
+ | `hudini serve folder/` | serve an overview of the logs in a folder |
233
+ | `hudini screen video.mp4` | find the popups that show an account name |
234
+ | `hudini frame image.png` | parse one image, JSON to stdout |
235
+ | `hudini catalog --locale de` | list the known instruments and pedal actions |
236
+ | `hudini fetch` | download the model checkpoints |
237
+
238
+ Options of `hudini parse`:
239
+
240
+ ```bash
241
+ hudini parse video.mp4 --signals pedals # one signal, its dependencies enable themselves
242
+ hudini parse video.mp4 --rate pedals=30 # sample one signal at 30 fps
243
+ hudini parse video.mp4 --fast # lower sampling rates for every signal
244
+ ```
245
+
246
+ ## Python API
247
+
248
+ Parse from Python:
249
+
250
+ ```python
251
+ from hudini.parser import Parser
252
+
253
+ parser = Parser() # loads every model once
254
+ log = parser.parse_video("video.mp4") # writes the log and returns it
255
+ ```
256
+
257
+ A stored log opens without the models. The views take the log, the
258
+ correction patches of the run, and the catalog:
259
+
260
+ ```python
261
+ from hudini.catalog import Catalog
262
+ from hudini.corrections import correct, rules_from_settings
263
+ from hudini.storage import load
264
+ from hudini.views import frame_view, interval_view
265
+
266
+ log = load("video.hudini.jsonl.gz")
267
+ catalog = Catalog.load()
268
+ patches = correct(log, rules_from_settings(log.header.corrections), catalog)
269
+ records = frame_view(log, patches, catalog) # one dict for each sampled frame
270
+ intervals = interval_view(log, patches, catalog) # the temporal runs of each arm and lane
271
+ ```
272
+
273
+ ## Development
274
+
275
+ ```bash
276
+ git clone https://github.com/claasdeboer/hudini && cd hudini
277
+ uv sync --extra dev --extra rfdetr
278
+ uv run pytest
279
+ uv run ruff check src/ tests/
280
+ uv run ty check src/hudini/
281
+ ```
282
+
283
+ ## Citation
284
+
285
+ hudini is accepted at AE-CAI @ MICCAI 2026. The BibTeX entry will
286
+ follow when it is available.
287
+
288
+ The interface annotations for DSAD, hSDB-instrument, and SurgVU are in
289
+ [nct-tso/hudini-annotations](https://huggingface.co/datasets/nct-tso/hudini-annotations).
290
+
291
+ ## License
292
+
293
+ Apache-2.0.