diffvid 1.0.1__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 (55) hide show
  1. diffvid-1.0.1/LICENSE +202 -0
  2. diffvid-1.0.1/NOTICE +5 -0
  3. diffvid-1.0.1/PKG-INFO +275 -0
  4. diffvid-1.0.1/README.md +231 -0
  5. diffvid-1.0.1/diffvid.egg-info/PKG-INFO +275 -0
  6. diffvid-1.0.1/diffvid.egg-info/SOURCES.txt +53 -0
  7. diffvid-1.0.1/diffvid.egg-info/dependency_links.txt +1 -0
  8. diffvid-1.0.1/diffvid.egg-info/entry_points.txt +2 -0
  9. diffvid-1.0.1/diffvid.egg-info/requires.txt +24 -0
  10. diffvid-1.0.1/diffvid.egg-info/top_level.txt +1 -0
  11. diffvid-1.0.1/pyproject.toml +41 -0
  12. diffvid-1.0.1/rollout_diff/__init__.py +169 -0
  13. diffvid-1.0.1/rollout_diff/__main__.py +5 -0
  14. diffvid-1.0.1/rollout_diff/_locotrack/__init__.py +1 -0
  15. diffvid-1.0.1/rollout_diff/_locotrack/cmdtop.py +47 -0
  16. diffvid-1.0.1/rollout_diff/_locotrack/locotrack_model.py +1077 -0
  17. diffvid-1.0.1/rollout_diff/_locotrack/nets.py +429 -0
  18. diffvid-1.0.1/rollout_diff/_locotrack/utils.py +301 -0
  19. diffvid-1.0.1/rollout_diff/arm_diff.py +324 -0
  20. diffvid-1.0.1/rollout_diff/batch.py +692 -0
  21. diffvid-1.0.1/rollout_diff/cli.py +475 -0
  22. diffvid-1.0.1/rollout_diff/core.py +879 -0
  23. diffvid-1.0.1/rollout_diff/explain.py +538 -0
  24. diffvid-1.0.1/rollout_diff/export.py +215 -0
  25. diffvid-1.0.1/rollout_diff/hub.py +207 -0
  26. diffvid-1.0.1/rollout_diff/object_diff.py +672 -0
  27. diffvid-1.0.1/rollout_diff/objects.py +245 -0
  28. diffvid-1.0.1/rollout_diff/objlog.py +903 -0
  29. diffvid-1.0.1/rollout_diff/point_diff.py +221 -0
  30. diffvid-1.0.1/rollout_diff/profile.py +215 -0
  31. diffvid-1.0.1/rollout_diff/report.py +758 -0
  32. diffvid-1.0.1/rollout_diff/robot_mask.py +238 -0
  33. diffvid-1.0.1/rollout_diff/teach.py +1374 -0
  34. diffvid-1.0.1/rollout_diff/world/__init__.py +25 -0
  35. diffvid-1.0.1/rollout_diff/world/changes.py +154 -0
  36. diffvid-1.0.1/rollout_diff/world/compare.py +139 -0
  37. diffvid-1.0.1/rollout_diff/world/config.py +28 -0
  38. diffvid-1.0.1/rollout_diff/world/match.py +458 -0
  39. diffvid-1.0.1/rollout_diff/world/models.py +214 -0
  40. diffvid-1.0.1/rollout_diff/world/plates.py +312 -0
  41. diffvid-1.0.1/rollout_diff/world/track.py +301 -0
  42. diffvid-1.0.1/rollout_diff/world_diff.py +11 -0
  43. diffvid-1.0.1/setup.cfg +4 -0
  44. diffvid-1.0.1/tests/test_batch.py +176 -0
  45. diffvid-1.0.1/tests/test_channels.py +249 -0
  46. diffvid-1.0.1/tests/test_explain.py +113 -0
  47. diffvid-1.0.1/tests/test_export_api.py +94 -0
  48. diffvid-1.0.1/tests/test_hub.py +199 -0
  49. diffvid-1.0.1/tests/test_intelligence.py +96 -0
  50. diffvid-1.0.1/tests/test_objects.py +117 -0
  51. diffvid-1.0.1/tests/test_objlog.py +395 -0
  52. diffvid-1.0.1/tests/test_point_diff.py +73 -0
  53. diffvid-1.0.1/tests/test_spatial.py +237 -0
  54. diffvid-1.0.1/tests/test_teach.py +456 -0
  55. diffvid-1.0.1/tests/test_world_diff.py +442 -0
diffvid-1.0.1/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 [yyyy] [name of copyright owner]
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.
diffvid-1.0.1/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ rollout-diff
2
+ Copyright 2026 the rollout-diff authors
3
+
4
+ This product includes software developed as part of the rollout-diff project
5
+ (https://github.com/HassenFChouchene/diffvid), licensed under the Apache License, Version 2.0.
diffvid-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.4
2
+ Name: diffvid
3
+ Version: 1.0.1
4
+ Summary: A git diff for robot runs: teach from a few good runs and check new rollouts (or diff two videos) for end-state, object-level, and timing failures — no VLM, no training, 100% Apache-2.0.
5
+ Author: Hassen F. Chouchene
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/HassenFChouchene/diffvid
8
+ Project-URL: Repository, https://github.com/HassenFChouchene/diffvid
9
+ Project-URL: Issues, https://github.com/HassenFChouchene/diffvid/issues
10
+ Project-URL: Live Demo, https://hassenfchouchene.github.io/diffvid/demo/
11
+ Keywords: robotics,lerobot,video-diff,dinov2,sam2,computer-vision,robot-learning
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Classifier: Topic :: Scientific/Engineering :: Image Recognition
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: NOTICE
23
+ Requires-Dist: numpy
24
+ Requires-Dist: scipy
25
+ Requires-Dist: opencv-python
26
+ Requires-Dist: pillow
27
+ Requires-Dist: torch
28
+ Requires-Dist: pandas
29
+ Requires-Dist: pyarrow
30
+ Requires-Dist: huggingface-hub>=0.23
31
+ Provides-Extra: objects
32
+ Requires-Dist: transformers>=4.40; extra == "objects"
33
+ Provides-Extra: track
34
+ Requires-Dist: einops; extra == "track"
35
+ Provides-Extra: world
36
+ Requires-Dist: transformers>=4.51; extra == "world"
37
+ Requires-Dist: torchvision; extra == "world"
38
+ Requires-Dist: scipy; extra == "world"
39
+ Provides-Extra: explain
40
+ Requires-Dist: transformers>=4.49; extra == "explain"
41
+ Requires-Dist: accelerate; extra == "explain"
42
+ Requires-Dist: qwen-vl-utils; extra == "explain"
43
+ Dynamic: license-file
44
+
45
+ <div align="center">
46
+
47
+ # rollout-diff
48
+
49
+ Compare robot runs on video and see what went differently.
50
+
51
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/HassenFChouchene/diffvid/blob/main/LICENSE)
52
+ ![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-3776ab)
53
+ [![Tests](https://github.com/HassenFChouchene/diffvid/actions/workflows/ci.yml/badge.svg)](https://github.com/HassenFChouchene/diffvid/actions/workflows/ci.yml)
54
+
55
+ [Example reports](https://hassenfchouchene.github.io/diffvid/demo/) ·
56
+ [Try it in Colab](https://colab.research.google.com/github/HassenFChouchene/diffvid/blob/main/examples/rollout_diff_colab.ipynb)
57
+
58
+ <img src="https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_hero_spin_table.gif" width="680" alt="Top: taught good demo. Bottom-left: unseen good run (PASS). Bottom-right: failed run where the cube is knocked onto the table and the basket stays empty (FAIL).">
59
+
60
+ <sub>Top: a taught good demo. Bottom-left: an unseen good run (PASS). Bottom-right: a failed run where the cube is knocked onto the table and never reaches the basket (FAIL).</sub>
61
+
62
+ </div>
63
+
64
+ You have a robot with a fixed camera and a few runs where the job went right.
65
+ rollout-diff learns from those runs and then checks new ones, for example the rollouts of a new policy checkpoint.
66
+ For each run it tells you what ended up different and when: something left on the table, a cup in the wrong bin,
67
+ an object still in the gripper, a step that took 4 s longer.
68
+
69
+ It doesn't know what a cup is. It points at the spot and the second, and the HTML report shows you the frames.
70
+ There is no VLM and nothing to train. The models (DINOv2, Grounding DINO, SAM 2.1) are Apache-2.0 and run on your own GPU.
71
+
72
+ ## Install
73
+
74
+ You need Python 3.10+ and an NVIDIA GPU. The models download on the first run.
75
+
76
+ ```bash
77
+ pip install "diffvid[world]"
78
+ # or the newest code from GitHub:
79
+ pip install "diffvid[world] @ git+https://github.com/HassenFChouchene/diffvid.git"
80
+ ```
81
+
82
+ The package is called `diffvid`; the command it installs is `rollout-diff`.
83
+
84
+ > **Windows (NVIDIA GPU):** `pip install torch` on Windows installs the CPU-only build by default.
85
+ > Install CUDA PyTorch first (otherwise runs will be very slow; `rollout-diff` warns if it detects CPU-only PyTorch):
86
+ > ```bash
87
+ > pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
88
+ > ```
89
+
90
+ ## Teach once, check every run
91
+
92
+ ```bash
93
+ # learn the task from a few good runs
94
+ rollout-diff teach good_runs/ --out task.teach
95
+
96
+ # check new runs against it
97
+ rollout-diff check task.teach eval_runs/ --out check.html --json check.json
98
+ ```
99
+
100
+ This is the output for the run in the GIF above (taught from 5 good runs, with `--objects`):
101
+
102
+ ```text
103
+ FAIL
104
+ UNEXPECTED cyan area here (bottom) at the end; differs from all 5 good runs (unusual from B 5.1 s)
105
+ INCOMPLETE region 1 (top) changed much less than in good runs (0 changed cells; good runs 11-19)
106
+ NOT PLACED the cyan thing from top-left ends bottom, not in region 1 (SAM 2.1 track)
107
+ LESS TIME -3.3 s at A 8.9-12.3 s (B faster)
108
+ ```
109
+
110
+ Some things to know:
111
+
112
+ - 3 to 5 good runs are enough to start. The timing checks need at least 4.
113
+ - A run can be an mp4, a folder of mp4s, or a LeRobot dataset, local or on the Hugging Face Hub
114
+ (`--episodes 0-19` picks the episodes; default is the first 5).
115
+ `--cam` is optional: leave it out and `rollout-diff` picks a fixed (non-wrist) camera automatically and prints all available camera names so you can switch with `--cam <name>`.
116
+ - If `teach` reports `0 fixed end-state region(s)`, that is normal when objects return to their start spot or end in varying places — `check` still watches the workspace for `UNEXPECTED` leftovers and timing shifts.
117
+ - Every run gets PASS or FAIL and its own HTML report with both videos playing in sync.
118
+ The exit code is 1 when a run fails, so you can use it in CI.
119
+ - `--objects` (passed to both `teach` and `check`) also follows every object the robot moves with SAM 2.1. It catches more
120
+ (wrong bin, dropped, still in the gripper, low-contrast items) but is about 4 times slower and fails more good runs on busy scenes.
121
+
122
+ ## What it reports
123
+
124
+ A **failure** makes the run FAIL:
125
+
126
+ | | |
127
+ | :--- | :--- |
128
+ | `UNEXPECTED` | something is left at the end where good runs leave nothing |
129
+ | `INCOMPLETE` | a region the good runs change barely changed |
130
+ | `WRONG TARGET` | an item ended in a different region than in the good runs |
131
+ | `WRONG STATE`, `WRONG SPOT`, `SPOT EMPTY` | a spot inside a region ends unlike in every good run: it looks different, changed where they don't, or stayed the same where they all change |
132
+ | `WRONG LAYOUT` | the overall arrangement in a region is unlike every good run's |
133
+ | `NOT PLACED`, `DROPPED`, `STILL HELD`, `WRONG POSE`, `NOT MOVED`, `EXTRA` | from `--objects`: what happened to one tracked object |
134
+
135
+ A **difference** is shown but the run still passes: `SLOWER`, `FASTER`, `SLOW STEP`, `UNUSUAL` (something odd seen during the run),
136
+ `SLIGHT SHIFT` and `POSE DIFF` (an object a bit off or tilted), and `ALREADY DONE` (the run started in the goal state).
137
+
138
+ ## Examples
139
+
140
+ | | |
141
+ | :---: | :---: |
142
+ | ![Two grocery items put into the wrong bins](https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_groceries_wrong_bin.gif) | ![The red cup ends next to the target cup](https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_glasses_not_placed.gif) |
143
+ | Two grocery items go into each other's bins. `WRONG TARGET` twice and `WRONG LAYOUT`. | An ACT policy puts the red cup next to the target cup. `NOT PLACED` and `SLOW STEP`. |
144
+ | ![The block slides off the turntable and out of view](https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_spin_dropped.gif) | ![Two unseen good runs that both pass](https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_glasses_good_pass.gif) |
145
+ | The block slides off the turntable and out of view. `DROPPED` at 9.6 s and `INCOMPLETE` for the basket. | Two unseen good runs with the cup in different spots and arm paths. Both PASS. |
146
+ | ![The cube is dropped and the run ends early](https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_spin_ends_early.gif) | ![A knocked cup and a slow step](https://raw.githubusercontent.com/HassenFChouchene/diffvid/main/docs/v1_glasses_unexpected.gif) |
147
+ | The cube is dropped at 5.6 s. `DROPPED`, `INCOMPLETE`, `ENDS EARLY` and `MORE TIME`. | A knocked cup and a step 4.3 s slower than normal. `UNEXPECTED`, `NOT PLACED`, `SLOW STEP`. |
148
+
149
+ The glasses runs come from a dataset that was not used while building the tool.
150
+
151
+ ## How well it works
152
+
153
+ One setting for all tasks, measured on an NVIDIA L4 with `experiments/check_eval.py`.
154
+ Tasks marked *dev* were used while building the rules, so treat them as less fair.
155
+ The two blind sets were run once, with no changes afterwards.
156
+
157
+ | Task | Failed runs caught | Good runs failed | Time per video |
158
+ | :--- | :---: | :---: | :---: |
159
+ | Dish tidy-up (BotFails) | 10 / 10 | 0 / 5 | 11.3 s |
160
+ | Set the table (BotFails) | 7 / 9 | 0 / 5 | 6.9 s |
161
+ | Fruit and veg sorting *(dev)* | 12 / 15 | 0 / 5 | 6.7 s |
162
+ | Groceries sorting *(dev)* | 4 / 5 | 0 / 5 | 9.8 s |
163
+ | Spinning table *(dev)* | 3 / 3 | 0 / 2 | 5.2 s |
164
+ | Stacking cups (ACT and Diffusion policies) | 11 / 13 | 1 / 12 | 5.3 s |
165
+ | Screws sorting | 7 / 10 | 2 / 2 | 8.4 s |
166
+ | **Main 7 tasks** | **54 / 65** | **3 / 36** | |
167
+ | Blind: Kapla tower | 6 / 7 | 0 / 4 | 9.8 s |
168
+ | Blind: piling glasses | 7 / 8 | 0 / 6 | 4.4 s |
169
+ | **Blind 2 tasks** | **13 / 15** | **0 / 10** | |
170
+
171
+ On the main tasks it pointed at the right spot for 50 of 73 labelled faults, and made 12 wrong claims in total.
172
+
173
+ With `--objects` it catches more (58 / 65 main, 14 / 15 blind) but fails more good runs (12 / 36 main, mostly the busy dish and
174
+ groceries scenes; 1 / 10 blind) and takes about 31 s per video. Use the default for a quick check and `--objects` when you want to dig in.
175
+
176
+ It is still weak on very small parts (10 px screws), on clear glass in front of a busy background, and on two look-alike objects that swap places.
177
+
178
+ <details>
179
+ <summary>Older results (two-video mode and timing)</summary>
180
+
181
+ Two-video mode, 41 new pairs never seen before (30 real differences, 15 good-vs-good pairs):
182
+ 20 of 30 differences found at the right place and time, 29 false items, 4 of 15 good pairs flagged.
183
+ On the 62 pairs used to set it up: 41 of 50 found, 16 false items, 3 of 20 good pairs flagged.
184
+
185
+ | Setup | Failures caught | Good runs with something reported |
186
+ | :--- | :---: | :---: |
187
+ | Spinning table (set up here) | 3 of 3 | 0 of 14 |
188
+ | Pouring coffee, BotFails (set up here) | 15 of 15 | 3 of 13 |
189
+ | Changed scene in a fixed cell: extra object, moved tray | 20 of 20 | – |
190
+ | Lego, busybox switch, buttons (good runs only) | – | 0 of 23 |
191
+ | Household data with a different layout every run (ViFailback, MolmoAct, SO-101) | about 85 of 100 | about half |
192
+
193
+ Timing on 50 human runs of a lego pick and place (`lerobot/svla_so101_pickplace`): 0 of 10 unseen good runs flagged;
194
+ a planted 2 s slowdown was found 10 of 10 times at the right place, 1 s only 3 of 10 times.
195
+ Comparing SmolVLA checkpoints 10 000 and 20 000 on a busybox switch, the median run went from 13.7 s to 11.6 s,
196
+ but the recording session mattered more than the checkpoint.
197
+
198
+ Tried and switched off: video-only arm diff (`--arm-diff`, 0 of 4 blind arm differences caught, 6 extra false items)
199
+ and monocular depth (16 of 22 good runs flagged).
200
+
201
+ </details>
202
+
203
+ ## How it works
204
+
205
+ 1. Grounding DINO finds the robot in every frame and SAM 2.1 cuts it out. That gives a start and an end picture of the scene without the robot.
206
+ 2. Start and end are compared on a 32 × 32 grid with DINOv2 features and colour.
207
+ 3. From the good runs it learns which regions change, what they look like at the end, and how much that varies.
208
+ Every threshold comes from leave-one-out over the good runs, so nothing is set by hand per task.
209
+ 4. A new run fails when its end falls outside what the good runs did.
210
+ 5. Timing: a DINOv2 fingerprint per frame, lined up with a good run by dynamic time warping.
211
+
212
+ With `--objects`, SAM 2.1 video follows each moved object forwards and backwards to see where it ends up.
213
+
214
+ ## Comparing just two runs
215
+
216
+ Without teaching, you can compare one good run with one new run:
217
+
218
+ ```bash
219
+ rollout-diff good.mp4 new.mp4 --world-diff --out report.html
220
+ rollout-diff good.mp4 new.mp4 --world-diff --also good2.mp4 good3.mp4 --out report.html # more good runs, fewer false alarms
221
+ rollout-diff "lerobot/svla_so101_pickplace#0" "lerobot/svla_so101_pickplace#12" --world-diff --out report.html
222
+ rollout-diff batch ckpt10k/ ckpt20k/ --episodes 0-19 --pair start --out dashboard/ --markdown summary.md
223
+ ```
224
+
225
+ This mode reports `MISSING OUTCOME`, `EXTRA CHANGE`, `WRONG PLACE`, `OBJECT LOST`, `OBJECT DIFF`, `END DIFF`, `ARM DIFF`
226
+ (from joint angles, when the dataset has them) and the timing items `MORE TIME`, `LESS TIME`, `SKIPPED`, `ENDS EARLY`.
227
+ It warns when the two runs don't start from the same scene. `batch` writes a dashboard for a whole folder or dataset.
228
+
229
+ From Python:
230
+
231
+ ```python
232
+ import rollout_diff as rd
233
+
234
+ d = rd.diff("good.mp4", "new.mp4", world_diff=True)
235
+ print(d.items)
236
+ d.save_html("report.html")
237
+ d.save_video("diff.gif")
238
+ ```
239
+
240
+ `rollout-diff --help`, `rollout-diff teach --help` and `rollout-diff check --help` list all options.
241
+
242
+ ## Limits
243
+
244
+ - One fixed camera. Wrist cameras and other moving cameras don't work.
245
+ - All runs should start from the same kind of scene. If every run starts with a different layout, good runs really do differ, and you will see those differences.
246
+ - A mistake that leaves nothing behind (pressing the wrong button) only shows up in the timing, or in the arm path when joint angles are recorded.
247
+ - Small things inside the gripper are hidden together with the robot.
248
+ - The robot cut-out can miss parts of a dark arm on a dark table; leftovers can show up as small false changes.
249
+
250
+ ## Data and licences
251
+
252
+ The GIFs, the example reports and the benchmark use Apache-2.0 datasets from the Hugging Face Hub:
253
+ [BotFails](https://huggingface.co/datasets/kantine/BotFails),
254
+ [piling glasses](https://huggingface.co/datasets/kantine/piling_glasses) and its [ACT evaluations](https://huggingface.co/datasets/kantine/eval_act_piling_glasses),
255
+ [Kapla tower](https://huggingface.co/datasets/kantine/so100_kapla_tower6) and its [anomaly set](https://huggingface.co/datasets/kantine/so100_kapla_tower6_anomaly),
256
+ the [spinning table](https://huggingface.co/ewinchell07) sets and
257
+ [lerobot/svla_so101_pickplace](https://huggingface.co/datasets/lerobot/svla_so101_pickplace).
258
+ The older results also use [busybox evaluations](https://huggingface.co/villekuosmanen), [anuma/so101_tray_red](https://huggingface.co/datasets/anuma/so101_tray_red),
259
+ ViFailback and MolmoAct; check their licences before reusing those videos.
260
+
261
+ Models: DINOv2, Grounding DINO tiny, SAM 2.1 small and LocoTrack-S, all Apache-2.0.
262
+
263
+ ## Citation
264
+
265
+ ```bibtex
266
+ @software{chouchene2026rolloutdiff,
267
+ author = {Chouchene, Hassen F.},
268
+ title = {rollout-diff: A git diff for robot runs},
269
+ year = {2026},
270
+ url = {https://github.com/HassenFChouchene/diffvid},
271
+ license = {Apache-2.0}
272
+ }
273
+ ```
274
+
275
+ The code is under the [Apache License 2.0](https://github.com/HassenFChouchene/diffvid/blob/main/LICENSE). Contributions are welcome, see [CONTRIBUTING.md](https://github.com/HassenFChouchene/diffvid/blob/main/CONTRIBUTING.md).