Resume TACO shared-v1.1 upload
Browse files- .gitattributes +1 -0
- TACO/shared-v1.1/doc/ARCHIVE_ONLY_VIDEOS.jsonl +99 -0
- TACO/shared-v1.1/doc/CONTRACT.md +576 -0
- TACO/shared-v1.1/doc/RAW_TO_SHARED.md +7 -0
- TACO/shared-v1.1/doc/SOURCE.json +1 -0
- TACO/shared-v1.1/doc/VALIDATION.json +68 -0
- TACO/shared-v1.1/doc/VIEW_MANIFEST.jsonl +3 -0
- TACO/shared-v1.1/doc/schema.json +1590 -0
- TACO/shared-v1.1/script/taco_annotations.py +396 -0
- TACO/shared-v1.1/script/taco_depth.py +122 -0
- TACO/shared-v1.1/script/taco_fast_depth.py +33 -0
- TACO/shared-v1.1/script/taco_hands_cache.py +128 -0
- TACO/shared-v1.1/script/taco_mask_alignment.py +166 -0
- TACO/shared-v1.1/script/taco_masks.py +140 -0
- TACO/shared-v1.1/script/taco_media_scratch.py +39 -0
- TACO/shared-v1.1/script/taco_native_audit.py +118 -0
- TACO/shared-v1.1/script/taco_rgb.py +153 -0
- TACO/shared-v1.1/script/taco_shared.py +433 -0
- TACO/shared-v1.1/script/taco_sparse_ffv1.py +128 -0
.gitattributes
CHANGED
|
@@ -55378,3 +55378,4 @@ TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/221
|
|
| 55378 |
TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/22139913_marker_removed/observation/rgb.mkv filter=lfs diff=lfs merge=lfs -text
|
| 55379 |
TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/22139914/observation/rgb.mkv filter=lfs diff=lfs merge=lfs -text
|
| 55380 |
TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/22139914_marker_removed/observation/rgb.mkv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 55378 |
TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/22139913_marker_removed/observation/rgb.mkv filter=lfs diff=lfs merge=lfs -text
|
| 55379 |
TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/22139914/observation/rgb.mkv filter=lfs diff=lfs merge=lfs -text
|
| 55380 |
TACO/shared-v1.1/data/(brush,[[:space:]]brush,[[:space:]]bowl)__20231006_145/22139914_marker_removed/observation/rgb.mkv filter=lfs diff=lfs merge=lfs -text
|
| 55381 |
+
TACO/shared-v1.1/doc/VIEW_MANIFEST.jsonl filter=lfs diff=lfs merge=lfs -text
|
TACO/shared-v1.1/doc/ARCHIVE_ONLY_VIDEOS.jsonl
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spatula, plate)/20230917_030/color.mp4"}
|
| 2 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spatula, plate)/20230917_031/color.mp4"}
|
| 3 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spatula, plate)/20231104_147/color.mp4"}
|
| 4 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, eraser, plate)/20231027_060/color.mp4"}
|
| 5 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, eraser, plate)/20231027_049/color.mp4"}
|
| 6 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, bowl)/20231027_066/color.mp4"}
|
| 7 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, bowl)/20231024_205/color.mp4"}
|
| 8 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, bowl)/20231027_071/color.mp4"}
|
| 9 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put out, spatula, plate)/20231104_166/color.mp4"}
|
| 10 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(skim off, bowl, pan)/20230926_015/color.mp4"}
|
| 11 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(skim off, bowl, pan)/20230926_016/color.mp4"}
|
| 12 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(hit, hammer, box)/20231002_058/color.mp4"}
|
| 13 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, bowl)/20230919_036/color.mp4"}
|
| 14 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, cup, kettle)/20231019_033/color.mp4"}
|
| 15 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, cup, kettle)/20231019_043/color.mp4"}
|
| 16 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(empty, bowl, plate)/20231024_242/color.mp4"}
|
| 17 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, roller, plate)/20231019_087/color.mp4"}
|
| 18 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spoon, pan)/20230923_019/color.mp4"}
|
| 19 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spatula, bowl)/20231024_210/color.mp4"}
|
| 20 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, eraser, kettle)/20231103_104/color.mp4"}
|
| 21 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, eraser, kettle)/20231103_105/color.mp4"}
|
| 22 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spoon, pan)/20230926_027/color.mp4"}
|
| 23 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, plate)/20230917_023/color.mp4"}
|
| 24 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, plate)/20231104_162/color.mp4"}
|
| 25 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, plate)/20230917_022/color.mp4"}
|
| 26 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spatula, plate)/20230917_020/color.mp4"}
|
| 27 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, plate)/20230919_033/color.mp4"}
|
| 28 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, plate)/20230919_031/color.mp4"}
|
| 29 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, plate)/20230919_032/color.mp4"}
|
| 30 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, plate)/20230919_030/color.mp4"}
|
| 31 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, box, plate)/20231027_178/color.mp4"}
|
| 32 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, spoon, plate)/20230917_006/color.mp4"}
|
| 33 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, spoon, pan)/20230926_010/color.mp4"}
|
| 34 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(screw, screwdriver, box)/20231102_049/color.mp4"}
|
| 35 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(screw, screwdriver, box)/20231102_013/color.mp4"}
|
| 36 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(skim off, spatula, pan)/20231013_003/color.mp4"}
|
| 37 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(skim off, spatula, pan)/20231013_010/color.mp4"}
|
| 38 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(measure, ruler, cup)/20231104_111/color.mp4"}
|
| 39 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(empty, cup, kettle)/20231019_044/color.mp4"}
|
| 40 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, roller, pan)/20231019_063/color.mp4"}
|
| 41 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, roller, pan)/20231019_203/color.mp4"}
|
| 42 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, roller, pan)/20231019_073/color.mp4"}
|
| 43 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir, spatula, pan)/20230923_008/color.mp4"}
|
| 44 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, knife, plate)/20230926_035/color.mp4"}
|
| 45 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, knife, plate)/20230926_036/color.mp4"}
|
| 46 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spoon, plate)/20230926_031/color.mp4"}
|
| 47 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spoon, plate)/20230917_024/color.mp4"}
|
| 48 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spoon, plate)/20230917_027/color.mp4"}
|
| 49 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spoon, plate)/20230917_026/color.mp4"}
|
| 50 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, toy)/20230919_039/color.mp4"}
|
| 51 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, teapot, cup)/20230917_041/color.mp4"}
|
| 52 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spatula, plate)/20230923_011/color.mp4"}
|
| 53 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spatula, plate)/20230923_013/color.mp4"}
|
| 54 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spatula, plate)/20230923_017/color.mp4"}
|
| 55 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, spatula, plate)/20231104_151/color.mp4"}
|
| 56 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, spatula, plate)/20231104_165/color.mp4"}
|
| 57 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, cup)/20230917_037/color.mp4"}
|
| 58 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, cup)/20230917_036/color.mp4"}
|
| 59 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, cup)/20230917_043/color.mp4"}
|
| 60 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, plate)/20230917_045/color.mp4"}
|
| 61 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, plate)/20231031_063/color.mp4"}
|
| 62 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, plate)/20230917_046/color.mp4"}
|
| 63 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(smear, eraser, bowl)/20231104_045/color.mp4"}
|
| 64 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, pan)/20230919_027/color.mp4"}
|
| 65 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, pan)/20231103_170/color.mp4"}
|
| 66 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, pan)/20230919_026/color.mp4"}
|
| 67 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, pan)/20230919_043/color.mp4"}
|
| 68 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(dust, brush, pan)/20230926_043/color.mp4"}
|
| 69 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, teapot, plate)/20230917_044/color.mp4"}
|
| 70 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spoon, plate)/20230917_017/color.mp4"}
|
| 71 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(cut, spoon, plate)/20230917_019/color.mp4"}
|
| 72 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, spatula, bowl)/20230926_007/color.mp4"}
|
| 73 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(dust, roller, kettle)/20231103_146/color.mp4"}
|
| 74 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, spoon, bowl)/20231105_022/color.mp4"}
|
| 75 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(smear, eraser, plate)/20231104_058/color.mp4"}
|
| 76 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir, spoon, pan)/20230923_020/color.mp4"}
|
| 77 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, bowl)/20231019_019/color.mp4"}
|
| 78 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, kettle, bowl)/20230917_034/color.mp4"}
|
| 79 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, helmet)/20230919_040/color.mp4"}
|
| 80 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, helmet)/20231027_017/color.mp4"}
|
| 81 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, helmet)/20230919_041/color.mp4"}
|
| 82 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, helmet)/20231027_019/color.mp4"}
|
| 83 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(brush, brush, helmet)/20230919_042/color.mp4"}
|
| 84 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, teapot, bowl)/20230917_032/color.mp4"}
|
| 85 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(dust, brush, teapot)/20230930_059/color.mp4"}
|
| 86 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spatula, pan)/20230923_001/color.mp4"}
|
| 87 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spatula, pan)/20230923_009/color.mp4"}
|
| 88 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir-fry, spatula, pan)/20230923_007/color.mp4"}
|
| 89 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, knife, box)/20231104_211/color.mp4"}
|
| 90 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put out, spatula, pan)/20231010_002/color.mp4"}
|
| 91 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(put in, bowl, plate)/20231024_223/color.mp4"}
|
| 92 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(pour in some, teapot, kettle)/20231019_047/color.mp4"}
|
| 93 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spoon, bowl)/20231105_062/color.mp4"}
|
| 94 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(skim off, bowl, bowl)/20231013_157/color.mp4"}
|
| 95 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(stir, spatula, plate)/20231104_150/color.mp4"}
|
| 96 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, knife, pan)/20231031_137/color.mp4"}
|
| 97 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(scrape off, spatula, pan)/20231010_004/color.mp4"}
|
| 98 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(skim off, spatula, bowl)/20230926_009/color.mp4"}
|
| 99 |
+
{"archive": "Egocentric_RGB_Videos.zip", "member": "Egocentric_RGB_Videos/(dust, roller, plate)/20231019_082/color.mp4"}
|
TACO/shared-v1.1/doc/CONTRACT.md
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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json](schema.json) 共同定义格式;后者是声明式注册表,不是 JSON Schema 或可执行校验器。本文已包含 v1.0 继续有效的完整语义,不要求读者拼接历史合同。
|
| 4 |
+
|
| 5 |
+
v1.1 只改变小型数值张量及对应 valid 的物理分组,不改变单位、坐标系、左右手、时间轴、来源、监督有效性或媒体编码。文件内键路径在本文以 `文件 → 字典键/data` 展示;箭头不是文件名的一部分。完整引用规则见第 6 节。
|
| 6 |
+
|
| 7 |
+
范围限于手物交互重建。只提取本任务要求、语义已核实且可可靠转换的字段;shared 不是 raw 镜像。缺失模态、未下载、未核实、未纳入分别报告;主要未纳入内容及原因写入 [RAW_TO_SHARED.md](RAW_TO_SHARED.md),不得虚构模态或用派生结果替代原生标注。
|
| 8 |
+
|
| 9 |
+
以下通用规范还包括其他数据集可能提供的可选字段,不表示 Dex-YCB 实际提供这些字段。Dex-YCB 实际内容见第 7 节。格式合同不承担运行状态快照:本地迁移报告可能早于发布;正式发布后应另附 `RELEASE.md` 的固定提交记录,不把历史报告中的 pending 改写成当时已经发布。
|
| 10 |
+
|
| 11 |
+
## 1. 目录与读取单位
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
```text
|
| 15 |
+
<dataset>/shared-v1.1/
|
| 16 |
+
doc/ # 完整合同、匹配 schema、字段映射、验收报告
|
| 17 |
+
script/ # 转换、读取和校验代码
|
| 18 |
+
data/<sequence_id>/<camera_id>/
|
| 19 |
+
metainfo.json
|
| 20 |
+
observation/
|
| 21 |
+
rgb.mkv
|
| 22 |
+
rgb_valid.pt # 原独立 bool Tensor,保持不变
|
| 23 |
+
depth.mkv
|
| 24 |
+
depth_valid.mkv # 逐像素有效性,保留压缩媒体格式
|
| 25 |
+
camera/
|
| 26 |
+
frames.jsonl
|
| 27 |
+
camera.pt # intrinsic、extrinsic、distortion
|
| 28 |
+
annotation/
|
| 29 |
+
mano/mano.pt # motion、visibility
|
| 30 |
+
keypoints/keypoints.pt # uv、xyz、visibility、whole_hand_visibility
|
| 31 |
+
object/<object_id>/
|
| 32 |
+
metainfo.json
|
| 33 |
+
articulation.json # 仅关节/部件结构实际存在时
|
| 34 |
+
object.pt # 位姿、可见性、几何点、关节、部件数值
|
| 35 |
+
assets/ # 原网格、材质、纹理及依赖
|
| 36 |
+
segment/
|
| 37 |
+
mask.mkv # 或 polygons.jsonl,按所选表示
|
| 38 |
+
instances.jsonl # 仅需要实例/区域编码映射时
|
| 39 |
+
mask_valid.pt # 原帧级 bool Tensor,保持不变
|
| 40 |
+
contact/
|
| 41 |
+
relations.jsonl
|
| 42 |
+
relations_valid.pt # 原帧级 bool Tensor,保持不变
|
| 43 |
+
<subject_id>__<object_id>/
|
| 44 |
+
contact.pt # vertex_region、vertex_distance
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
只创建实际提供的组件和字段。以上不是每个数据集必须填满的模板;缺失内参、MANO、深度等不能通过占位文件伪装为已提供。序列/相机的两层结构不变,物体与模态目录属于相机内部组件。
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
## 2. 相机视图的 metainfo.json
|
| 51 |
+
|
| 52 |
+
### 2.1 顶层字段与发布信息
|
| 53 |
+
|
| 54 |
+
每个相机视图必须有 `metainfo.json`。以下字段除另行说明外均为必填:
|
| 55 |
+
|
| 56 |
+
| 字段 | 填写内容 |
|
| 57 |
+
|---|---|
|
| 58 |
+
| schema_version | 结构版本,本版为 `hand-warehouse/1.1` |
|
| 59 |
+
| dataset_id | 数据集的逻辑标识 |
|
| 60 |
+
| release_id | 本次数据发布版本,对应目录中的 dataset_version |
|
| 61 |
+
| sequence_id | 所属序列或独立图片样本的标识 |
|
| 62 |
+
| camera_id | 当前相机视图标识 |
|
| 63 |
+
| sample_type | `image` 或 `video`,规则见 2.2 |
|
| 64 |
+
| num_frames | 当前视图帧数 T,所有随帧组件按同一时间轴组织 |
|
| 65 |
+
| hand_slots | 固定为 `["left", "right"]`;解剖学左右的使用规则见 5.1 |
|
| 66 |
+
| sampling | 采样类型、源 FPS、帧索引引用及选择策略,见 2.2 |
|
| 67 |
+
| camera | 当前相机模型与图像尺寸,见 2.3 |
|
| 68 |
+
| components | 实际提供的组件及其文件、schema、有效性和来源,见 2.5 |
|
| 69 |
+
| split | `train/val/test/unknown`,划分协议见 2.4 |
|
| 70 |
+
| view_type | 必填,固定为 `ego/exo/unknown`。源数据或采集设置明确相机视角时必须填写 `ego` 或 `exo`;只有无法从可信来源确定时才填写 `unknown`,不得省略或主观猜测。多相机序列须逐视图分别填写。 |
|
| 71 |
+
|
| 72 |
+
`dataset_version` 是数据发布版本;`schema_version` 是结构版本,两者独立。原始包校验摘要、官方来源和转换配置应记录在发布清单中。解压发生在临时工作区,原始包保持不变。
|
| 73 |
+
|
| 74 |
+
### 2.2 图片、视频与 sampling
|
| 75 |
+
|
| 76 |
+
`sample_type=image`:允许单图 T=1、`sampling.type=single`,也允许将独立图片批量装入一个视频容器,T>1 时 `sampling.type=independent`、`source_fps=null`。分片大小按数据集选择;FreiHAND 默认每片最多 4096 张,训练与评估分开,尾片不补帧。该数量不是其他数据集的强制要求;同批分���率、相机模型类型及划分协议一致。每行 frames 必须有稳定且唯一的 `sample_id`、原始文件定位;内参、手形状等仍逐帧保留,不能因打包而共享错误的标定或身份。`sequence_id` 在这里仅是批次标识,不代表真实序列;不得按相邻帧推断跟踪、同步或接触延续。源 camera_id、image_variant、split 等随样本变化时放在 frames 的对应字段中。真实采集时间未知则 timestamp_ns=null。合成背景变体不视为真实多相机。
|
| 77 |
+
|
| 78 |
+
`sample_type=video`:`sampling.type=dense/sparse`;`source_fps` 是真实采集 FPS,未知为 null。非连续取样必须保留源帧号和已知源时间,不可用采样后索引除以 FPS 冒充源时间。可另记采样策略与步长。
|
| 79 |
+
|
| 80 |
+
shared 可以仅存所选 RGB 帧对应的数据。OakInk2 图像/动捕不同采样率时用 annotation_matches 明确映射;不要求将未采样动捕点硬塞进 T。多视角身份和源同步关系要保留;选择了哪些帧/相机及原因写在 sampling 中。
|
| 81 |
+
|
| 82 |
+
`sampling.frames_ref` 指向 `camera/frames.jsonl`。帧号、逐帧时间、同步与标注匹配记录的结构见 4.1;MKV 封装时间的约定见 3.1。
|
| 83 |
+
|
| 84 |
+
### 2.3 camera 模型声明
|
| 85 |
+
|
| 86 |
+
`camera` 至少包含 `model`、`schema_id`、`image_size:[W,H]`。模型未知使用 `unknown` 和 `null`,不猜成针孔。实际内参、畸变及外参数组放在 `camera/`,各模型的固定结构见第 4 节。
|
| 87 |
+
|
| 88 |
+
### 2.4 split 与划分协议
|
| 89 |
+
|
| 90 |
+
保留上游划分,不将同一采集序列的相邻帧随意拆到不同集合。
|
| 91 |
+
|
| 92 |
+
有官方划分时必填 split_scheme 和 split_source_locator,split_scheme 区分如 Dex-YCB s0/s1、ARCTIC P1/P2 等选定协议;不知道时 split=unknown 并给理由,不凭空分配。每发布可选择一种协议;存在逐帧差异时 frames 中的 split 覆盖视图默认值,并登记其来源。
|
| 93 |
+
|
| 94 |
+
### 2.5 components 组件登记
|
| 95 |
+
|
| 96 |
+
组件表的键是本发布内唯一名称,例如 `rgb`、`depth`、`mano`、`keypoints_uv`。每个已提供组件声明以下信息;模态特有参数在第 3–5 节对应小节中定义。
|
| 97 |
+
|
| 98 |
+
| 字段 | 约定 |
|
| 99 |
+
|---|---|
|
| 100 |
+
| available | 本发布是否提供该组件;缺省也表示未提供 |
|
| 101 |
+
| schema_id | 已登记的具体存储与语义类型,不得临时创造未登记名称 |
|
| 102 |
+
| data_ref | 数据文件路径,相对当前相机视图根目录,使用 POSIX 路径 |
|
| 103 |
+
| data_key / valid_key | 数值 bundle 的嵌套键路径;独立媒体、JSONL 和独立 valid 不设置这些键,见第 6 节 |
|
| 104 |
+
| axes | 数组各维度的含义 |
|
| 105 |
+
| valid_ref / valid_axes | 有效性文件及其维度;语义由所属组件规定 |
|
| 106 |
+
| storage / valid_storage | 存储配置;视频包含 profile、codec、pixel_format、encoded_size,见 3.1;数值字典统一采用 pt/tensor_bundle/v1,见第 6 节 |
|
| 107 |
+
| provenance | source / format_conversion / derived,以及转换或生成方法 |
|
| 108 |
+
| source_locator | 原文件、压缩包成员和记录/帧的定位信息 |
|
| 109 |
+
|
| 110 |
+
不存在的组件允许缺省或写作 `{ "available": false, "reason": "..." }`,不用引用不存在的文件。静态网格可声明标量有效性;具体见 5.4。观测的 valid 见第 3 节,标注的 valid 与 visibility 区分见 5.1。
|
| 111 |
+
|
| 112 |
+
`provenance.kind` 使用 source/format_conversion/derived,`method` 说明转换或生成方法;发布清单补充脚本版本、参数、输入摘要。`source_locator` 定位到原始文件/压缩包成员和记录、帧号;允许引用有完整溯源清单的前一发布,但链条最终应能回到 raw。不得仅写一个无法定位记录的数据集名字。
|
| 113 |
+
|
| 114 |
+
`.pt` 仅保存 CPU Tensor,不保存 Python 自定义对象;浮点默认 float32,有效性为 bool,浮点无效位置填 NaN。所有随帧数组保留首维 T,单帧也不 squeeze;静态资产按其 schema 单独声明。单位、坐标及固定形状见各组件小节。
|
| 115 |
+
|
| 116 |
+
机器注册表 `schema.json` 中,`components` 固定解码后的数据类型、形状、单位和语义;`storage_profiles` 固定视频内的编码/还原方式。不得临时创造未登记的 schema_id 或 storage.profile。同一语义允许选择其登记的不同无损存储 profile。
|
| 117 |
+
|
| 118 |
+
## 3. observation 观测数据
|
| 119 |
+
|
| 120 |
+
### 3.1 rgb.mkv 与 rgb_valid.pt
|
| 121 |
+
|
| 122 |
+
RGB、深度和栅格 mask 在 shared 中统一使用 MKV 视频容器,不展开为逐帧图片或图像 tar。MANO、关键点、位姿等数值标注仍用数组;分割的重叠多边形仍用 JSONL,不为了视频化而有损栅格化。单图可为一帧视频,独立图批量封装规则见 2.2。
|
| 123 |
+
|
| 124 |
+
**无损指共享层不增加信息损失。** 源 JPEG/H.264 等本身可能已是有损编码,原样保留并不恢复已丢失信息;不得重新以有损 JPEG、H.264、H.265、AV1 参数编码。源视频/图片的色彩、位深、分辨率和几何关系不得被静默改变。RGB schema `rgb/uint8/v1` 的统一读取结果是 `[T,H,W,3] uint8`、RGB 通道,有效性仍为 `rgb_valid.pt [T] bool`。超出该 schema 的高位深或 HDR 源必���报告并扩展定义,不能降到 8 位冒充无损。
|
| 125 |
+
|
| 126 |
+
#### 3.1.1 允许的 RGB 存储 profile
|
| 127 |
+
|
| 128 |
+
| storage.profile | 编码方式 | 适用规则 |
|
| 129 |
+
|---|---|---|
|
| 130 |
+
| mkv/mjpeg_copy/v1 | 源 JPEG 压缩帧直接封装成 MJPEG/MKV | 不解码重编码;保持每张 JPEG 码流字节;普通 8 位 JPEG 且 MKV/解码器支持时使用 |
|
| 131 |
+
| mkv/source_copy/v1 | 已有视频的 RGB 对应码流直接封装为 MKV | 仅源编码能被 MKV 和选定解码器支持时使用,不伪造帧;需维持正确的呈现顺序与依赖帧 |
|
| 132 |
+
| mkv/h264_rgb_lossless/v1 | libx264rgb 的真正无损模式 | 必须 RGB 路径、CRF=0,并通过全帧 RGB 字节比较;不能替换成默认 libx264 YUV420 路径 |
|
| 133 |
+
| mkv/ffv1_rgb/v1 | FFV1 的 RGB 可逆编码路径 | 作为通用候选;解码回 RGB 后必须逐字节相同,不做色度降采样 |
|
| 134 |
+
|
| 135 |
+
优先尝试源码流直接封装;不能封装或需要选择稀疏帧时,比较 FFV1 与无损 RGB H.264。对完整待发布片段,只在通过无损验收的候选中选择文件较小者,不假设某个编码器总最小;编码时间和随机读取代价记入构建记录。中间候选不作为 shared 多份常驻。H.264 跨帧压缩允许较长 GOP,必须记录 GOP/关键帧间隔,随机取帧需从前一关键帧正确解码,不能把 seek 返回的近似帧当目标帧。
|
| 136 |
+
|
| 137 |
+
普通源视频可以保留它已有的有损码流,但不允许新增有损重编码。源是 VRS 等记录容器时,先查明图像流实际编码:已有兼容 JPEG/视频包可直接提取封装,否则解码后使用真正无损编码;不把整个 VRS 改后缀当 MKV。PNG 不要求直接塞进 MKV,可选上表两种无损重编码方式。
|
| 138 |
+
|
| 139 |
+
#### 3.1.2 视频配置与校验
|
| 140 |
+
|
| 141 |
+
每个视频组件在 metainfo 中登记 `storage`,至少包含:
|
| 142 |
+
|
| 143 |
+
| 字段 | 内容 |
|
| 144 |
+
|---|---|
|
| 145 |
+
| profile | 上述登记的存储 profile;语义仍由组件 schema_id 指定 |
|
| 146 |
+
| codec | 文件中实际 codec,例如 mjpeg、h264、ffv1;source_copy 必须写实际 codec |
|
| 147 |
+
| pixel_format | 实际编码像素格式;不得仅凭编码器参数猜测 |
|
| 148 |
+
| encoded_size | 视频物理像素尺寸 `[width,height]`;深度可能不同于逻辑尺寸,见 3.2 |
|
| 149 |
+
| decoder | 解码器名称、版本,以及颜色矩阵/范围/旋转处理等实际像素解释配置;未知的源色彩声明 unknown,不擅自称为 sRGB |
|
| 150 |
+
| encoder_parameters | 重编码时的编码器、版本、无损模式和 GOP 等参数;直接封装时记录 stream_copy |
|
| 151 |
+
| source_lossy | 源是否已有损:true / false / unknown;不是共享层再有损编码的许可 |
|
| 152 |
+
|
| 153 |
+
无损重新编码的 RGB 必须使用同一固定解码配置,比较**全部帧**的统一 RGB 字节、数量及顺序。MJPEG-copy 不重新编码,生产校验采用 `jpeg-packets-all-rgb-sample16/v1`:从 MKV 逐包取回,对全部源 JPEG 的 SHA256、数量、顺序和图像尺寸进行精确核对;每视图另用同一固定解码配置比较最多 16 帧的源与目标 RGB 字节(含首尾与四分位位置,其余由固定种子抽取)。记录策略、实际索引、种子与结果;不足 16 帧时全查。试点与最终完整序列随机抽查,对选中视图的全部帧复核解码 RGB。历史已做全帧像素检查的证明继续保留。
|
| 154 |
+
|
| 155 |
+
逐包一致与像素抽查的范围必须分别声明,不能将抽查写成全量像素检查。不能用 PSNR 高、视觉相似、编码器参数称为 lossless 等替代精确检查。同时保留源编码的色彩标记和必要元数据;原图有 EXIF/色彩/方向等元数据时保留 raw 和必要来源信息;不能静默自动旋转图像而不更新像素对应与标定。以上加速策略仅适用于原 JPEG 码流直接封装,不适用于深度、标签或重新编码的 RGB。
|
| 156 |
+
|
| 157 |
+
所有共享视频的呈现帧顺序与统一 frame_index 一一对应,每个栅格组件恰好 T 帧。MKV 的 `storage_fps` 只服务封装,声明 `timebase_role=index_only`;source_copy 可以保留源 PTS 以避免改坏码流,但真实时间与标注对齐仍以 frames 为准。未知真实时间保留 null。缺失某帧组件时保留索引位置并使用该组件的无效占位/valid 标识,不删帧;不能以重复相邻图像冒充已知观测。
|
| 158 |
+
|
| 159 |
+
### 3.2 depth.mkv 与 depth_valid.mkv
|
| 160 |
+
|
| 161 |
+
深度语义仍是 `depth/z_float32/v1`:统一读取结果 `[T,H,W] float32`,米制相机 Z 分量,`depth_type=z`。有效深度有限且大于 0,无效位置为 NaN。`depth_origin=measured/rendered/unknown` 必填,来源不明时 unknown。默认与 RGB 共用像素网格及相机参考系,不处理未注册 RGB-D。射线距离必须依据源定义转换成 z,不能只改声明。
|
| 162 |
+
|
| 163 |
+
#### 3.2.1 float32 的可逆视频编码
|
| 164 |
+
|
| 165 |
+
采用 `mkv/depth_float32_bits/v1`:**不是把深度量化成 uint16**,而是将规范化后每个 IEEE-754 float32 的完整 32 位拆成两个 uint16,使用 FFV1 gray16le 保存。视频物理尺寸为 `[2W,H]`:每行前 W 列存原 float32 位串的低 16 位,后 W 列存高 16 位。读取时先��并为 uint32 位串,再按 float32 重新解释,不能数值 cast 成 float32。
|
| 166 |
+
|
| 167 |
+
```text
|
| 168 |
+
u = reinterpret_uint32(depth_float32)
|
| 169 |
+
encoded[:, :, :W] = uint16(u & 65535)
|
| 170 |
+
encoded[:, :, W:] = uint16(u >> 16)
|
| 171 |
+
u_restored = uint32(low) | (uint32(high) << 16)
|
| 172 |
+
depth_float32 = reinterpret_float32(u_restored)
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
统一采用 little-endian 原始字节接口。`camera.image_size` 始终是逻辑 RGB 尺寸 `[W,H]`,不能改成编码视频的 2W;`storage.encoded_size=[2W,H]`。包括 NaN 在内的 float32 位串必须全帧完全恢复,不允许改成 float16、整数毫米、归一化灰度或 RGB 伪彩色。这里的无损验收基准是完成既定米制/坐标转换后的标准 float32 数组,不声称消除 float64→float32 等原约定转换本身的舍入。
|
| 176 |
+
|
| 177 |
+
#### 3.2.2 逐像素有效性
|
| 178 |
+
|
| 179 |
+
`depth_valid.mkv` 使用 `mkv/bool_ffv1/v1`,FFV1 gray8(FFmpeg pixel_format=`gray`),物理尺寸 `[W,H]`。像素只能为 0 或 1,统一解码为 `[T,H,W] bool`,逐像素含义不变。这样不再把庞大的 bool 数组保存为未压缩 `.pt`;标注的帧级/手级 valid 仍保留原有小数组。
|
| 180 |
+
|
| 181 |
+
登记示例(W、H 以下取 640、480;decoder/encoder_parameters 的实际版本由转换器填写):
|
| 182 |
+
|
| 183 |
+
```json
|
| 184 |
+
{
|
| 185 |
+
"available": true,
|
| 186 |
+
"schema_id": "depth/z_float32/v1",
|
| 187 |
+
"data_ref": "observation/depth.mkv",
|
| 188 |
+
"axes": ["T", "height", "width"],
|
| 189 |
+
"valid_ref": "observation/depth_valid.mkv",
|
| 190 |
+
"valid_axes": ["T", "height", "width"],
|
| 191 |
+
"unit": "m",
|
| 192 |
+
"depth_type": "z",
|
| 193 |
+
"depth_origin": "measured",
|
| 194 |
+
"invalid_value": "NaN",
|
| 195 |
+
"storage": {
|
| 196 |
+
"profile": "mkv/depth_float32_bits/v1",
|
| 197 |
+
"codec": "ffv1",
|
| 198 |
+
"pixel_format": "gray16le",
|
| 199 |
+
"encoded_size": [1280, 480],
|
| 200 |
+
"source_lossy": false,
|
| 201 |
+
"decoder": {"name": "ffmpeg", "version": "填写实际版本"},
|
| 202 |
+
"encoder_parameters": {"name": "ffv1", "level": 3, "version": "填写实际版本"}
|
| 203 |
+
},
|
| 204 |
+
"valid_storage": {
|
| 205 |
+
"profile": "mkv/bool_ffv1/v1",
|
| 206 |
+
"codec": "ffv1",
|
| 207 |
+
"pixel_format": "gray",
|
| 208 |
+
"encoded_size": [640, 480],
|
| 209 |
+
"source_lossy": false,
|
| 210 |
+
"decoder": {"name": "ffmpeg", "version": "填写实际版本"},
|
| 211 |
+
"encoder_parameters": {"name": "ffv1", "version": "填写实际版本"}
|
| 212 |
+
},
|
| 213 |
+
"provenance": {"kind": "format_conversion", "method": "源深度转米制 z float32;逐位打包为 FFV1"},
|
| 214 |
+
"source_locator": {"file": "raw/data/depth.zip", "member": "depth/0001.png"}
|
| 215 |
+
}
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
深度和有效性视频都必须逐帧解码验收:float32 位串相同、bool 相同、T 相同,并检查 valid=true 的正有限值和 valid=false 的 NaN。读取器必须按 profile 还原,不能把 depth.mkv 的编码像素直接当深度值。
|
| 219 |
+
|
| 220 |
+
## 4. camera 相机、帧索引与标定
|
| 221 |
+
|
| 222 |
+
### 4.1 frames.jsonl:索引、时间与对应关系
|
| 223 |
+
|
| 224 |
+
`camera/frames.jsonl` 每行对应统一帧号 `frame_index=0..T-1`,是所有组件的唯一行索引。至少包含 `frame_index`、`timestamp_ns`、`clock_domain`、`source_locator`;原始帧号/文件名保存在 `source_frame_id`,不能被新帧号替代。每行还可有 `annotation_matches`,按组件键保存 `source_frame_id`、`source_timestamp_ns`、`clock_domain`、`match_method` 和 `delta_ns`;方法为 exact/index_map/nearest/interpolated,索引映射无时间依据时 delta_ns=null。nearest 必须记录允许误差;interpolated 必须记录两端源标识和权重。delta_ns 仅在同一时间域中计算为源标注时间减图像时间。多相机共享 `sequence_id`;已知同步关系必须用 `sync_id` 或明确的源帧/时间映射表达,不能仅凭相同数组索引认定同步。
|
| 225 |
+
|
| 226 |
+
每个视图必须提供此文件。源时间使用整数纳秒及 `clock_domain`,未知写 JSON `null`;不同时间域不能直接比较。逐帧 split 可以覆盖 metainfo 的视图默认划分,并保留来源,见 2.4。
|
| 227 |
+
|
| 228 |
+
### 4.2 坐标系与标定通则
|
| 229 |
+
|
| 230 |
+
| 项目 | 统一约定 |
|
| 231 |
+
|---|---|
|
| 232 |
+
| 相机坐标 | 右手系,X 向右、Y 向下、Z 向前,长度单位米 |
|
| 233 |
+
| 齐次变换 | 列向量,`p_target = T_target_from_source @ p_source` |
|
| 234 |
+
| 图像坐标 | `(u,v)`;左上像素中心为 `(0,0)`,u 向右、v 向下,单位 pixel |
|
| 235 |
+
| 固定标定 | 本版展开为 T 份,同一 schema 不混用静态与动态形状 |
|
| 236 |
+
| 分辨率或模型变化 | 分开存储为视图/片段,不在同一组件中混装 |
|
| 237 |
+
| 未知标定 | 相机内外参允许缺省,不填单位阵冒充已知标定 |
|
| 238 |
+
|
| 239 |
+
### 4.3 camera.pt → intrinsic/data 与畸变参数
|
| 240 |
+
|
| 241 |
+
| model / schema_id | camera.pt → intrinsic/data 的固定结构 |
|
| 242 |
+
|---|---|
|
| 243 |
+
| pinhole / camera/pinhole/v1 | `[T,3,3]`,标准 K,最后一行为 `[0,0,1]`;限无畸变或已校正图像 |
|
| 244 |
+
| fisheye624 / camera/fisheye624/v1 | `[T,15]`,`[f,cx,cy,k0,k1,k2,k3,k4,k5,p0,p1,s0,s1,s2,s3]`,采用 Project Aria Fisheye624 投影定义 |
|
| 245 |
+
| opencv_fisheye4 / camera/opencv_fisheye4/v1 | `camera.pt → intrinsic/data [T,3,3]` 保存 K;同组件 `distortion_ref` 指向 `[T,4]`,顺序 `[k1,k2,k3,k4]`,使用 OpenCV fisheye 等距角度多项式;已由 ReInterHand 实际原始相机参数验证 |
|
| 246 |
+
| rational8 / camera/rational8/v1 | `camera.pt → intrinsic/data [T,3,3]` 保存 K;同组件必需 `distortion_ref` 指向 `[T,8]`,顺序 `[k1,k2,p1,p2,k3,k4,k5,k6]` |
|
| 247 |
+
| unknown / null | 不提供可用 intrinsic,不声称可以投影 |
|
| 248 |
+
|
| 249 |
+
有畸变的其他模型必须注册新 schema,固定参数名、顺序和投影公式;不能塞进针孔 K 后遗失畸变项。`metainfo.camera.schema_id` 必须与 intrinsic 组件一致。同一模型的别名不可隐式改变参数布局。
|
| 250 |
+
|
| 251 |
+
`opencv_fisheye4`:对前方点令 `x=X/Z, y=Y/Z, r=sqrt(x²+y²), theta=atan(r)`,`theta_d=theta*(1+k1*theta²+k2*theta⁴+k3*theta⁶+k4*theta⁸)`;`u=fx*x*theta_d/r+cx, v=fy*y*theta_d/r+cy`。光轴 r=0 时使用连续极限 `theta_d/r=1`。四系数不能按普通径向畸变解释,也不能补零冒充 Fisheye624。
|
| 252 |
+
|
| 253 |
+
rational8 对归一化坐标 x=X/Z、y=Y/Z,令 r²=x²+y²,径向项为 `(1+k1*r²+k2*r⁴+k3*r⁶)/(1+k4*r²+k5*r⁴+k6*r⁶)`;再加 p1/p2 切向项并经 K 得到像素。`distortion_ref` 与 intrinsic 共用 `[T]` valid,保存到 camera/camera.pt → distortion/data。不得把这种畸变三维坐标当作真实相机系 xyz 保存。
|
| 254 |
+
|
| 255 |
+
内参有效性为 `camera.pt → intrinsic/valid [T] bool`;有畸变时使用对应 `distortion_ref`。同一模型的参数名和顺序固定。
|
| 256 |
+
|
| 257 |
+
### 4.4 camera.pt → extrinsic/data 与 camera.pt → extrinsic/valid
|
| 258 |
+
|
| 259 |
+
`camera.pt → extrinsic/data` 为 `[T,4,4]`,schema `transform/se3/v1`,方向固定 `T_camera_from_world`,有效性 `[T]`。世界坐标含义及源坐标转换记录在 provenance 中;只有相机坐标标注不要求虚构世界坐标。旋转块须正交且 determinant≈1。
|
| 260 |
+
|
| 261 |
+
## 5. annotation 标注数据
|
| 262 |
+
|
| 263 |
+
### 5.1 标注通则:手槽、valid 与 visibility
|
| 264 |
+
|
| 265 |
+
手槽固定为 0=left、1=right,指解剖学左右,不按画面位置或可见性重排。本阶段只处理左右手两槽,不处理更多手。实体引用使用 `hand_left`、`hand_right`;手槽不证明跨采集片段的个人身份。
|
| 266 |
+
|
| 267 |
+
#### 5.1.1 valid:标注是否可用于监督
|
| 268 |
+
|
| 269 |
+
标注的 `valid=true` 表示:有对应实际标注、通过本 schema 数值检查,且通过来源明确提供并适用于该组件的有效性/QA 条件。`valid=false` 可由缺标注、无法建立帧对应、源无效占位或官方 QA 不通过导致;不等于画面没有手或手不可见。各组件独立判断,MANO 按 `[T,2]` 标记左右手,关键点按 `[T,2,K]` 标记。
|
| 270 |
+
|
| 271 |
+
**2026-09-20 将标注 valid 从“仅表示存在”修订为“可用于监督”,字段形状不变。** 公式为 `source_annotation_present AND numerical_checks_pass AND applicable_official_QA_pass`。没有官方 QA 时省略最后一项,不伪造 QA;不能把未知当成已通过已存在的 QA。适配器在组件 `valid_policy` 中记录具体规则、来源、聚合/广播作用域。缺失官方必需 QA 的记录须明确处理为未知或暂停验收,不能静默通过。无效浮点项仍填 NaN,原始数据保留在 raw;被排除原值可用于 doc 中明确标识的诊断渲染,不能冒充 shared 有效监督。
|
| 272 |
+
|
| 273 |
+
本地筛选须依据明确的规则,并在 `valid_policy.local_excluded_frame_indices`、排除原因和正式报告中记录。单个可疑投影作为问题记录,不直接硬编码排除该帧。已确认的曝光异常须明确作用范围,不能把一个序列的“前两帧有问题”套到所有序列。RGB 编码完好与几何监督可用是两件事,允许保留原图及帧索引而屏蔽对应标注;未发现问题不等于完成全部人工审核,试点待确认时不能作为已验收发布使用。
|
| 274 |
+
|
| 275 |
+
源字段必须按官方语义映射,不能直接按名字复制:
|
| 276 |
+
|
| 277 |
+
| 来源 | 官方含义 | 映射原则 |
|
| 278 |
+
|---|---|---|
|
| 279 |
+
| [H2O](https://github.com/taeinkwon/h2odataset) 的手标注首位 | 0 未标注、1 已标注 | 可作为对应手标注存在性的依据,不推断未标注原因 |
|
| 280 |
+
| [HOT3D](https://github.com/facebookresearch/hot3d#using-mask-files) 的 pose_available、visible、mask_qa_pass | 分别表达姿态存在、可见性、对画面中可见手物位姿的人工 QA | 逐手/物体记录决定存在性,再 AND 当前相机当前帧 QA;QA 是整帧聚合判定,保守排除该帧全部手物几何监督,不声称每个实体均有错误;源可见性基于位姿推导时,其自身 valid 同样受 QA 约束 |
|
| 281 |
+
| [Dex-YCB](https://github.com/NVlabs/dex-ycb-toolkit#loading-dataset-and-visualizing-samples) 的全零 pose_m、全 -1 joints | 不可见的手或缺标注共用占位表示 | 对应组件 valid=false;不能从该值判定 visibility=false,也不能声称原因是动捕缺失 |
|
| 282 |
+
| [ARCTIC](https://github.com/zc-alexfan/arctic/blob/master/docs/data/data_doc.md) 的 is_valid/left_valid/right_valid | 是否有效用于官方评估 | 核实每项筛选依据;不把可见性/评估选择直接等同 QA。本次原始 mano.npy 不含这些派生评估标记,按原记录与数值检查生成 valid,并声明没有额外官方 QA ���入 |
|
| 283 |
+
|
| 284 |
+
源 valid=false 若代表评估筛选或其他条件,应检查实际标注和源约定后映射;不能一律清空坐标。反之,占位零或 -1 只有在源官方明确规定时才判为缺失,不泛化成所有数据的判断规则。
|
| 285 |
+
|
| 286 |
+
`valid=true` 的标注应通过其 schema 的数值与形状检查;检查失败必须报告或修复,不能静默隐藏。QA 不通过应报告排除数量与原因,并保留可追溯信息;不能把这类无效称为缺标注。RGB、深度等观测有效性仍按各自 schema;手物 QA 不自动否定 RGB、静态相机内参或物体资产。相机外参是否过滤须依据其自身来源规则;HOT3D 本次保留源外参用于溯源和诊断,不能用其存在性证明 QA 失败帧的几何监督正确。
|
| 287 |
+
|
| 288 |
+
#### 5.1.2 visibility:可见性属性
|
| 289 |
+
|
| 290 |
+
附加质量属性只保留 `visibility`,存放在对应模态或标注集内,不设 quality 目录。同一份可见性仅存一次;uv 与 xyz 共用时引用同一个文件。
|
| 291 |
+
|
| 292 |
+
visibility 通过所属组件 attributes 登记 data_ref/data_key、valid_ref/valid_key、axes、dtype、visibility_type、meaning、provenance、source_locator;未知值通过属性 valid_ref 标识,数值可见性即使全已知也须保存同字段的 bool valid Tensor;只有静态外部资产允许声明标量 valid=true。比例与布尔值不相互强转,也不按任意阈值二值化。没有 MANO 时,整手可见性挂在 keypoints 组件,使用 keypoints bundle 中独立的 whole_hand_visibility 字段(keypoints.pt → whole_hand_visibility/data),明确 meaning=whole_hand,不与逐关键点可见性混用。
|
| 293 |
+
|
| 294 |
+
`valid` 回答“这项标注能否用于监督”,`visibility` 回答“在当前图像中是否可见(或可见多少)”。不可见的手或关键点仍可有有效标注;不能因 visibility=0 就清空坐标。源没有 visibility 时缺省或标为未知,不由 valid 推断。
|
| 295 |
+
|
| 296 |
+
| 情况 | 手标注 valid | visibility |
|
| 297 |
+
|---|---|---|
|
| 298 |
+
| RGB 已开始录制,动捕尚未开始,没有其他对应手标注 | false | 以独立源可见性标注为准;没有则未知 |
|
| 299 |
+
| 手被遮挡,但源有标注且通过适用有效性检查 | true | 若源声明不可见,则 false 或源可见比例 |
|
| 300 |
+
| 手可见且有对应标注,通过适用 QA | true | 若源有此信息,则 true 或源可见比例 |
|
| 301 |
+
| 手可见,但该帧漏标或动捕中断 | false | 可以为 true,但必须有独立来源依据 |
|
| 302 |
+
| 有手部参数,但官方 QA 明确不通过 | false | 不据此断言不可见;源可见比例若基于不可靠位姿,其属性 valid 也为 false |
|
| 303 |
+
|
| 304 |
+
visibility 自己的 valid_ref 表示该可见性标注是否可用,不复用 MANO 或关键点坐标的 valid_ref;明确记录源存在性及适用的 QA 条件。上述例子不要求凭图像自动生成可见性。
|
| 305 |
+
|
| 306 |
+
不设 quality 组件或目录,不另存拟合误差、曝光、截断比例等通用质量数组。适用的官方 QA 合并进对应 valid,在 `valid_policy` 记录来源与规则;正式校验报告保留原始 QA 时间区间及排除统计。原始 QA 文件仍在 raw,官方 split 保留。
|
| 307 |
+
|
| 308 |
+
### 5.2 mano:参数与整手可见性
|
| 309 |
+
|
| 310 |
+
MANO schema `mano/axis_angle61/v1`:`mano.pt → motion/data [T,2,61]`,顺序为完整 16 关节 axis-angle 48、shape betas 10、全局平移 3。姿态使用弧度,平移米,位于当前相机系。有效性 `[T,2]`;缺少一侧整槽 NaN。PCA 必须先按对应模型展开,不能将 PCA 系数直接填入 axis-angle。
|
| 311 |
+
|
| 312 |
+
`model_profile` 必须固定 MANO 版本、`flat_hand_mean=true`、左手 shapedirs 修正状态。平移表示模型输出顶点所加的全局平移,不是某个腕关节的坐标;源语义不同须转换。shape 无量纲。模型权重不作为共享数据附带上传。
|
| 313 |
+
|
| 314 |
+
`mano/mano.pt → visibility/data [T,2]` 保存源整手可见比例时使用 float32 [0,1],`visibility_type=ratio`;只有实际采用 0–100 的百分比才除以100,不能只凭表头判断。HOT3D 的 `visibility_ratio[%]` 实值已经是0–1,官方读取器原样读取,必须保留原值。通过 MANO 组件 attributes 登记,使用独立有效性,不复用 motion_valid。
|
| 315 |
+
|
| 316 |
+
手部共享表示仅保留 MANO 参数与选定关键点,不发布独立手表面几何。需要渲染或接触计算时由 MANO 参数生成,几何引用使用固定 MANO 模型配置与顶点顺序;不影响 object 下的物体模型和材质资产。
|
| 317 |
+
|
| 318 |
+
### 5.3 keypoints:二维点、三维点与逐点可见性
|
| 319 |
+
|
| 320 |
+
关键点独立于 MANO 参数存在;没有 motion 也可有关键点。`keypoints.pt → uv/data [T,2,K,2]` 与 `keypoints.pt → xyz/data [T,2,K,3]`,有效性 `[T,2,K]`,分别采用 `keypoints/uv/v1` 和 `keypoints/xyz/v1`。K 由 `keypoint_schema` 固定,不能在同一数组中逐帧变化;同体系统一顺序。数值使用像素坐标或米制相机系。
|
| 321 |
+
|
| 322 |
+
| keypoint_schema | K 与固定索引 |
|
| 323 |
+
|---|---|
|
| 324 |
+
| mano21/v1 | 21;wrist 后依次 thumb/index/middle/ring/little,每指由近端至指尖 |
|
| 325 |
+
| rhd21/v1 | 21;保持 wrist,然后五指由近端至指尖;原始每指 tip→palm 反序。只统一顺序,不宣称解剖学位置等价于 MANO |
|
| 326 |
+
|
| 327 |
+
具体名称与源索引映射见 `schema.json`。当前只登记 MANO21 与 RHD21;不登记 MediaPipe、ReInterHand capture21 或 fit24 中间关键点。
|
| 328 |
+
|
| 329 |
+
每个发布中的每个视图只提供一套标准手关键点,直接放在 keypoints 下,不设 annotation_set_id 字段或目录。uv 与 xyz 是这套关键点的二维与三维表示,不是两套标注。provenance 分别记录二者来自原始标注还是计算结果;不要求已有 2D 必须由当前 xyz 重新投影覆盖。
|
| 330 |
+
|
| 331 |
+
ReInterHand 的 Original keypoints、Original fits keypoints 及带前臂关键点不纳入 shared;如需手关键点,从选定 MANO 参数生成 MANO21 并记录模型/指尖回归约定。其他数据集默认使用选定的官方关键点,不额外生成平行的 MANO 派生集合。后续主动更换生成方法或结果时发布新的 dataset_version,不在同一版本内增设方法分支。
|
| 332 |
+
|
| 333 |
+
manual/projection/fitting 只记录在 provenance,不作为目录或类型分支。不得通过坐标为零、是否出画或 visibility 判断标注是否存在。派生标注仅在实际生成并通过数值检查后声明 valid=true;没有生成的项为 false,不伪造坐标。
|
| 334 |
+
|
| 335 |
+
`keypoints/keypoints.pt → visibility/data [T,2,K]` 保存源逐点可见性,布尔表示使用 `visibility_type=boolean`。uv 与 xyz 共用时引用同一份文件。整手比例属性没有 MANO 可挂载时使用 `keypoints.pt → whole_hand_visibility/data [T,2]`,`meaning=whole_hand`;它与逐点可见性分开,通用登记规则见 5.1。
|
| 336 |
+
|
| 337 |
+
不使用 annotation_set_id;ReInterHand 中间关键点集合不进入 shared,raw 保留来源文件。
|
| 338 |
+
|
| 339 |
+
### 5.4 object:身份、资产、位姿与几何
|
| 340 |
+
|
| 341 |
+
#### 5.4.1 metainfo.json:物体身份与跟踪作用域
|
| 342 |
+
|
| 343 |
+
手用 `hand_left`、`hand_right` 及槽位 0、1 表示,不再另存 entities.json。物体身份登记在 `annotation/object/<object_id>/metainfo.json`,必填 `object_id`、`identity_scope`、`scope_id`、`source_locator`;可含 `category_id`、`source_object_id`、`mesh_ref`、`has_model`、部件引用。即使只有分割、没有 pose/mesh,也可只有这份物体元信息。
|
| 344 |
+
|
| 345 |
+
`identity_scope` 为 frame/subsequence/sequence,`scope_id` 指定具体作用域;跨相机共享身份只在已有源对应证据时使用。VISOR 按官方 subsequence 与实体名关联时记录 `association_basis=official_subsequence_entity_name`,不能声称这是全视频物理实例跟踪。无需与 object_id 一一对应的标准 track_id;官方独立轨迹标识存在时保留为 source_track_id,并声明作用域。手槽不证明跨采集片段的个人身份。
|
| 346 |
+
|
| 347 |
+
#### 5.4.2 assets:网格、材质与纹理
|
| 348 |
+
|
| 349 |
+
资产属于物体,统一存放在 `annotation/object/<object_id>/` 内,可用 `assets/` 子目录组织网格、材质、纹理和部件资产。序列层不设共享 assets。所有引用采用视图根目录为基准;其中物体资产组件的 `data_ref` 与部件的 `mesh_ref` 采用相对于当前视图目录的 POSIX 路径,例如 `annotation/object/cup_01/assets/cup.obj`,且必须指向所属物体目录内的资产。OBJ 内部的材质、纹理引用遵循文件格式自身的相对路径规则,依赖文件一并保留。不同相机视图允许各自保存物体资产,不要求跨视图去重;下载物体时包含其资产依赖。
|
| 350 |
+
|
| 351 |
+
网格 schema 为 `mesh/obj/v1`,顶点米制,静态有效性可直接声明标量 `valid`,或通过 `valid_ref` 指向标量 bool Tensor;不按 T 重复静态资产。由物体/部件通过引用关联,不仅凭文件名猜测。
|
| 352 |
+
|
| 353 |
+
#### 5.4.3 object.pt → pose/data、object.pt → pose/valid 与 所属 bundle → visibility/data
|
| 354 |
+
|
| 355 |
+
刚体 schema 为 `object/rigid/v1`,`object.pt → pose/data [T,4,4]` 固定为 `T_camera_from_object`,平移米制,有效性 `[T]`。物体坐标原点、轴向必须与 mesh 一致;旋转块为正交矩阵且 determinant≈1。
|
| 356 |
+
|
| 357 |
+
`object/<id>/object.pt → visibility/data [T]` 保存源物体可见比例,float32 [0,1],`visibility_type=ratio`。通过所属物体组件 attributes 登记,独立表达其有效性。
|
| 358 |
+
|
| 359 |
+
#### 5.4.4 articulation.json、部件位姿与 object.pt → joint_state/data
|
| 360 |
+
|
| 361 |
+
关节物体:schema `object/articulated/v1`,`articulation.json` 登记 `parts` 与 `joints`。每个 part 有 `part_id`、`parent_id`(根为 null)、`has_model`、`mesh_ref`;has_model=false 时 mesh_ref=null,结构节点允许没有网格。父链不得成环。每个 joint 有唯一 `joint_id`、`parent_part`、`child_part`、`type`;fixed 单位 null、revolute 弧度、prismatic 米。有源限位时保存 `limits:[lower,upper]`;没有时 null,不伪造上下限。部件姿态统一为 `T_camera_from_part [T,4,4]`,保存在所属物体 `object.pt → parts/<part_id>/pose/{data,valid}`,不与父局部变换混装。
|
| 362 |
+
|
| 363 |
+
若提供 `object.pt → joint_state/data [T,J]`,必须登记固定 joint_order、轴在父部件系的表达、零位变换与正方向,valid 为 `[T,J]`;缺少这些运动学定义时只发布部件位姿与已有来源信息,不伪造可驱动的关节模型。关节值与部件位姿同时存在时需验证一致性。
|
| 364 |
+
|
| 365 |
+
部件层级应声明语义:纯语义包含树允许 `joints=[]`,不将包含关系推断为机械关节。关节状态 schema 为 `object/joint_state/v1`;转动用弧度、移动用米,混合类型按 joint_order 对应的关节定义解释。
|
| 366 |
+
|
| 367 |
+
#### 5.4.5 dimensions、几何关键点与顶点部件标签
|
| 368 |
+
|
| 369 |
+
`object.pt → dimensions/data [T,3]` 采用 `object/dimensions/v1`,有效性为 `[T]`。
|
| 370 |
+
|
| 371 |
+
物体/部件 `dimensions` 为 `[length,width,height]` 米,轴顺序与该 mesh 的局部坐标关联,登记 `dimensions_semantics` 和来源。HOI4D dimensions 与 mesh 的具体尺度关系未验证前标为 source_unspecified,保留源值并暂停依赖该关系的几何验收,不能默认为待施加缩放。需要施加缩放时明确 scale_applied_to_mesh,禁止重复应用。
|
| 372 |
+
|
| 373 |
+
源物体关键点放 `object/<id>/object.pt → keypoints/xyz/data [T,K,3]`(相机系)或 `object.pt → keypoints/template_xyz/data [K,3]`(物体系),schema 分别为 object_keypoints/camera/v1 和 object_keypoints/template/v1。明确 keypoint_schema、keypoint_names、单位及有效性;模板点配合 pose 可投影,无须重复生成全部帧。H2O 中心/角点/棱中点,以及 ARCTIC 部件点分别登记具体源顺序,不套用手的 21 点 schema。每个发布选择一套源几何点并记录选择,不另建方法分支。
|
| 374 |
+
|
| 375 |
+
`object.pt → meshes/<mesh_id>/vertex_part_ids/data [V] int64` 绑定 `mesh_ref` 与 topology_id,登记整数到 part_id 的映射;未知用 -1。ARCTIC 不同拓扑的资产分别绑定,不能共用未经转换的顶点标签。部件层级中 is_instance/has_model 等源属性保留,几何文件仍全部归 object。
|
| 376 |
+
|
| 377 |
+
### 5.5 segment:分割类别、编码与覆盖范围
|
| 378 |
+
|
| 379 |
+
每个发布选择一套任务使用的分割表示,不建立方法/标注集分支。没有分割就不创建 segment 目录,不为其他模态创建空的实体表。
|
| 380 |
+
|
| 381 |
+
| schema_id | 文件与数值语义 |
|
| 382 |
+
|---|---|
|
| 383 |
+
| segment/uint16_labels/v1 | mask.mkv;整数区域编号,通过 instances.jsonl 解释 |
|
| 384 |
+
| segment/instance_polygons/v1 | polygons.jsonl;实例多边形,可重叠;当前不支持孔洞拓扑 |
|
| 385 |
+
| segment/foreground_intensity/v1 | mask.mkv;0–255 前景强度,不是区域编号或经过校准的概率 |
|
| 386 |
+
|
| 387 |
+
#### 5.5.1 uint16 标签图与 instances.jsonl
|
| 388 |
+
|
| 389 |
+
组件声明 `segmentation_type=semantic/instance/part`;同一组件固定一种类型。`mask.mkv` 解码为 `[T,H,W] uint16`,schema `segment/uint16_labels/v1`,使用 `mkv/uint16_ffv1/v1`,FFV1 gray16le 无损;只有所有区域编码均 ≤255 时允许 gray8(pixel_format=gray),读取后转 uint16,数值不变。禁止调色板和有损编码。有效性 `[T]`,表示该帧有可用分割标注。数值 0 固定为 unassigned,65535 固定为 ignore,1–65534 为区域编码,不能直接等同 entity_id。
|
| 390 |
+
|
| 391 |
+
`instances.jsonl` 每帧一行,包含 `frame_index` 与 `labels`。每条标签包含 `mask_value`、`category_id`、`entity_id`、`part_id`;无意义或未知字段为 null。semantic 允许 entity_id=null;instance 必须引用 hand_left/hand_right 或登记的 object_id;part 还须关联登记部件。源实例 ID 和其他属性分别保存在 `source_instance_id`、`source_attributes`。mask 中每个非保留编码必须有且仅有一个映射。
|
| 392 |
+
|
| 393 |
+
FreiHAND 的试点按本任务需要,统一到手/背景类别,保留每个原生区域编码;不要求给原生细分区域猜测手指名称。需要细部件监督时,尚未核实的部件名称必须保持未知,不能因粗粒度手类别已核实便声称部件语义也已统一。
|
| 394 |
+
|
| 395 |
+
#### 5.5.2 重叠实例多边形
|
| 396 |
+
|
| 397 |
+
每发布选择一套任务使用的分割表示,不建立方法/标注集分支。VISOR 的实际试点存在重叠实例多边形,单层标签图不能无损表达。对此补充 `segment/instance_polygons/v1`:`segment/polygons.jsonl` 每帧包含 `frame_index` 和 `instances`,每实例包含 `mask_value` 与 `polygons`(列表,每个多边形为源图像像素坐标顶点序列,保留原始精度)。身份和类别仍由同一 `instances.jsonl` 映射,有效性仍为 `[T]`,通过 schema 区分物理编码。允许多实例重叠,不采用后画覆盖前画。消费者按需栅格化为独立实例二值 mask;不能声称合并的单层 mask 无损。
|
| 398 |
+
|
| 399 |
+
#### 5.5.3 灰度前景强度
|
| 400 |
+
|
| 401 |
+
ReInterHand 的官方渲染 mask 为双手合并的灰度前景掩码,实测存在 0–255 的中间值,不是左右手实例编号。登记 `segment/foreground_intensity/v1`:仍存 `segment/mask.mkv`,解码为 `[T,H,W] uint16`,使用 `mkv/uint16_ffv1/v1`,此类数据优先编码为 FFV1 gray8(pixel_format=gray),读取后转 uint16。有效值范围 0–255,归一化值为 `float32(value)/255`;0 为背景端点、255 为前景端点。组件声明 `foreground_category=hand`、`entity_id=null` 和双手合并语义,不使用区域编号映射。这里保留原始渲染 mask 强度,不把它称为经过校准的概率。若任务需要二值 mask,阈值化属于任务层派生操作,记录阈值;共享层不丢弃中间灰度。不同 schema 的数值含义不同,不能将该文件按整数类别图解码。
|
| 402 |
+
|
| 403 |
+
FreiHAND 训练集的 JPEG mask 使用 `segment/foreground_intensity/v1`,逐像素保留 JPEG 解码后的灰度,`entity_id=hand_right`。该 schema 不限定双手合并:单手或合并范围由 `entity_id` 与 `coverage` 明确声明。评估集整数区域图仍用 `segment/uint16_labels/v1`,两者不能仅凭文件名使用同一种解码语义。
|
| 404 |
+
|
| 405 |
+
#### 5.5.4 coverage 与有效性
|
| 406 |
+
|
| 407 |
+
`coverage.kind=full/selected_entities/partial/unknown`。full 指声明的标注范围完整;selected_entities 还应列出目标范围。无论哪种,0 本身不自动成为背景;背景要有明确类别映射,未标注区域不能用于构造负样本。保留源逐类/逐实例 exhaustive 信息,未知不可改写为完整。
|
| 408 |
+
|
| 409 |
+
三种表示的帧级有效性均为 `[T]`,表示该帧是否提供此分割标注;对应 valid_ref 在组件中登记,仍用小型 bool `.pt` 数组。栅格 mask 必须登记 storage,格式见 3.1.2,所有帧的整数编码或强度逐值完全相同。编码语义由 schema_id 决定,读取器不能仅依据 mask.mkv 文件名选择解码方式。
|
| 410 |
+
|
| 411 |
+
### 5.6 contact:接触、抓取、区域与距离
|
| 412 |
+
|
| 413 |
+
#### 5.6.1 relations.jsonl 与 relations_valid.pt
|
| 414 |
+
|
| 415 |
+
`annotation/contact/relations.jsonl`,schema contact/relations/v1,每帧一行含 frame_index、relations。每条记录含 relation_type(contact/grasp)、subject_id(手槽或登记实体)、object_id、status、source_locator、provenance。status 固定为 positive/negative/unknown/target_unannotated:positive 必须有可解析目标,negative 表示源明确否定该关系,unknown 为不确定,target_unannotated 为确有接触但目标未标注。非 positive 的 object_id 可 null,不能用 null 冒充“不接触”。稀疏源无记录的帧不自动补 negative。
|
| 416 |
+
|
| 417 |
+
VISOR 的对象 mask ID 必须先按同帧 source_instance_id 解析成 object_id;hand-not-in-contact、none-of-the-above、inconclusive 分别映射 negative、target_unannotated、unknown,保留原始字符串。Dex ycb_grasp_ind 通过 ycb_ids 映射到登记物体,以 relation_type=grasp 保存;不得当作逐顶点接触。
|
| 418 |
+
|
| 419 |
+
relations 组件的 valid_ref 指向 `relations_valid.pt [T] bool`,表示该帧是否有可用源关系标注。有效帧中可以存在 status=unknown 的明确不确定标注;无源标注的帧为 valid=false、relations=[]。组件仍声明 available/provenance/source_locator。
|
| 420 |
+
|
| 421 |
+
#### 5.6.2 实体对的顶点区域与距离
|
| 422 |
+
|
| 423 |
+
已发布的接触区域/距离按参与关系的 subject_id 与 object_id 组织,每对实体保留选定的一套结果,以精确 geometry_ref/topology_id 关联到手或物体/部件;不要求每套数据都有。顶点区域 schema contact/vertex_region/v1:bool `[T,V]` 加同形 valid;顶点距离 schema contact/vertex_distance/v1:float32 `[T,V]`、米、同形 valid,声明 source/target geometry_ref、distance_definition(signed/unsigned、测量到点集或表面等明确源定义)。geometry_ref 必须指向已登记 mesh 或由固定 MANO 模型配置确定的拓扑;拓扑/顶点数变化时按拓扑拆分片段。其他源区域表示只有在实际接入并登记 schema 后才可转换,不能随意栅格化宣称等价。
|
| 424 |
+
|
| 425 |
+
顶点区域/距离已有存储定义,但尚未完成真实输入试点;接入时必须提供源语义与几何验收证据,不因已经登记 schema 就视为通过。
|
| 426 |
+
|
| 427 |
+
## 6. v1.1 数值 bundle 与引用规则
|
| 428 |
+
|
| 429 |
+
### 6.1 合并边界
|
| 430 |
+
1. 数值张量与对应有效性必须在同一个 `.pt` 文件、同一个字段字典内保存:`{"data": Tensor, "valid": BoolTensor}`。这些数值张量组件不再生成独立的 `*_valid.pt`;媒体和 JSONL 的有效性文件不受此规则影响。
|
| 431 |
+
2. 按组件合并经常一起读取的小张量:相机内参、外参、畸变放在一个 `camera.pt`;MANO 参数与整手可见性放在一个 `mano.pt`;手关键点的二维、三维与可见性放在一个 `keypoints.pt`。
|
| 432 |
+
3. 每个物体的数值字段及全部部件数值字段合并为一个 `object.pt`。不同物体、不同相机、不同序列不合成一个全局大文件,以保留按需下载和读取能力。
|
| 433 |
+
4. RGB、深度、栅格 mask 继续使用原无损媒体格式,不把解码后的大数组或媒体字节塞进 `.pt`。它们的有效性文件保持原文件名、Tensor/媒体格式、形状和引用方式,不包装为字典。
|
| 434 |
+
5. `metainfo.json`、`camera/frames.jsonl`、实例映射、物体身份/运动学定义与网格资产保留原格式。此次不把 JSON、JSONL、OBJ、纹理全部打进一个字典。
|
| 435 |
+
|
| 436 |
+
合���只改变存储方式,不改变采样、帧数、张量内容或有效性判定。不为减少字段数而将多个组件的 valid 合成一个公共 valid。
|
| 437 |
+
|
| 438 |
+
### 6.2 字典结构与有效性
|
| 439 |
+
本次合并的数值组件 `.pt` 根对象为字符串键的 Python `dict`,内部仅允许嵌套字符串键字典和 CPU `torch.Tensor`,不保存自定义类、模型、NumPy 对象或任意可执行对象。元信息、schema、单位和来源放在 metainfo,不在每个张量条目中重复保存。读取使用 `torch.load(path, map_location="cpu", weights_only=True)`。第 6.3 节保留的独立有效性 `.pt` 根对象仍为 CPU bool Tensor,不适用字典结构要求。
|
| 440 |
+
|
| 441 |
+
例如,`camera/camera.pt` 的逻辑结构为:
|
| 442 |
+
|
| 443 |
+
```python
|
| 444 |
+
{
|
| 445 |
+
"intrinsic": {"data": K, "valid": K_valid},
|
| 446 |
+
"extrinsic": {"data": T_camera_from_world, "valid": extrinsic_valid},
|
| 447 |
+
"distortion": {"data": distortion, "valid": distortion_valid},
|
| 448 |
+
}
|
| 449 |
+
```
|
| 450 |
+
|
| 451 |
+
以上变量均为 Tensor。未提供的字段整个省略;例如无世界系外参时不保存 `extrinsic`,不填单位矩阵。没有单独畸变向量的模型不创建 `distortion`:Fisheye624 仍使用既定 `[T,15]` 内参参数布局。
|
| 452 |
+
|
| 453 |
+
数值字段统一为 `data` 与 `valid` 两个叶子。源属性原先显式声明全已知 `valid=true` 时,迁移可按该属性的有效性形状展开为全 true 的 bool Tensor;这是已有有效性声明的等价表示,不是根据数值或姿态推测有效性。有效性必须为 bool Tensor,不能用 Python `True` 代替字段内的 Tensor。静态数值字段同样配套 valid,形状采用其语义定义的标量或逐元素有效性;静态网格等外部资产仍可在 metainfo 中声明标量 valid。
|
| 454 |
+
|
| 455 |
+
valid 的形状不要求与 data 完全相同,但必须与该字段定义一致。例如 MANO 为 `[T,2,61]` / `[T,2]`,内参为 `[T,3,3]` / `[T]`,关键点为 `[T,2,K,3]` / `[T,2,K]`。按 schema 将 valid 扩展到相应数值维度,不允许依靠碰巧可广播推断语义。
|
| 456 |
+
|
| 457 |
+
浮点默认 float32,无效浮点位置仍为 NaN;bool 和整数沿用该组件的占位/保留值规则,不因没有 NaN 而视为有效。valid 表达可用监督,不只是“值有限”或“记录存在”;适用官方 QA 与已经确认的排除规则继续保留。不能用 `isfinite(data)` 重建 valid,不能因为迁移而把 false 改成 true。
|
| 458 |
+
|
| 459 |
+
不同字段的 valid 独立保存和解释。visibility 的 valid 不复用姿态 valid;内参 valid 不代替外参 valid。既有相机模型要求内参与单独畸变向量共用有效性时,在两个字段内保存相同 bool 值并校验一致,而不改变该模型的联合标定规则。
|
| 460 |
+
|
| 461 |
+
### 6.3 固定分组与字段名
|
| 462 |
+
下表中的键路径用 `/` 展示字典层级;它不是文件系统路径。数值字段均在列出的键下继续存储 `data`、`valid`。
|
| 463 |
+
|
| 464 |
+
| 文件 | 数值字段键 | 内容 |
|
| 465 |
+
|---|---|---|
|
| 466 |
+
| `camera/camera.pt` | `intrinsic`、`extrinsic`、`distortion` | 逐帧标定;形状、参数顺序与相机模型定义不变 |
|
| 467 |
+
| `annotation/mano/mano.pt` | `motion`、`visibility` | MANO `[T,2,61]` 与源整手可见性;各有独立有效性 |
|
| 468 |
+
| `annotation/keypoints/keypoints.pt` | `uv`、`xyz`、`visibility`、`whole_hand_visibility` | 手关键点及源可见性;整手与逐点可见性不混用 |
|
| 469 |
+
| `annotation/object/<id>/object.pt` | `pose`、`visibility`、`dimensions`、`joint_state` | 该物体的数值标注 |
|
| 470 |
+
| 同上 | `keypoints/xyz`、`keypoints/template_xyz` | 相机系逐帧点或物体系静态模板点 |
|
| 471 |
+
| 同上 | `parts/<part_id>/pose`、`parts/<part_id>/dimensions`、`parts/<part_id>/keypoints/xyz`、`parts/<part_id>/keypoints/template_xyz` | 部件数值字段,部件身份仍由 articulation 登记 |
|
| 472 |
+
| 同上 | `meshes/<mesh_id>/vertex_part_ids` | `[V] int64` 顶点部件标签,valid 为 `[V]`,未知 -1 对应 false;每个 mesh 单独绑定拓扑 |
|
| 473 |
+
| `annotation/contact/<subject_id>__<object_id>/contact.pt` | `vertex_region`、`vertex_distance` | 已登记拓扑上的接触区域/距离与同形有效性 |
|
| 474 |
+
|
| 475 |
+
顶点部件标签使用注册类型 `object/vertex_part_ids/v1`。物体的 mesh_id、part_id 必须在 metainfo/运动学定义中可解析;不同拓扑不能误用同一顶点数组。未提供的可见性、关节值或模板点不生成空字段。
|
| 476 |
+
|
| 477 |
+
**媒体和 JSONL 的有效性保持原样,不参与字典合并:**
|
| 478 |
+
|
| 479 |
+
| 数据本体 | 有效性文件 | 存储形式 |
|
| 480 |
+
|---|---|---|
|
| 481 |
+
| `observation/rgb.mkv` | `observation/rgb_valid.pt` | 独立 CPU bool Tensor `[T]` |
|
| 482 |
+
| `annotation/segment/mask.mkv` 或 `polygons.jsonl` | 原 `valid_ref` 指定的文件,通常为 `annotation/segment/mask_valid.pt` | 独立 CPU bool Tensor `[T]`;沿用原路径 |
|
| 483 |
+
| `annotation/contact/relations.jsonl` | `annotation/contact/relations_valid.pt` | 独立 CPU bool Tensor `[T]` |
|
| 484 |
+
| `observation/depth.mkv` | `observation/depth_valid.mkv` | 原逐像素 bool 无损视频 `[T,H,W]` |
|
| 485 |
+
|
| 486 |
+
不新建仅包装上述 valid 的 observation.pt、segment.pt 或关系级 contact.pt。现有���体/JSONL 的 `valid_ref`、`valid_axes` 及适用的 `valid_storage` 保持原定义;深度编码、NaN 位串还原与像素有效性规则不变。实体对的接触区域/距离是数值张量,仍按上表合并到各实体对的 contact.pt。
|
| 487 |
+
|
| 488 |
+
### 6.4 metainfo 的文件与字典键引用
|
| 489 |
+
文件定位与字典内部定位分开登记,不在文件名中拼接自定义分隔符:
|
| 490 |
+
|
| 491 |
+
| 字段 | 定义 |
|
| 492 |
+
|---|---|
|
| 493 |
+
| `data_ref` | 相对当前相机视图根目录的 POSIX 文件路径 |
|
| 494 |
+
| `data_key` | 非空字符串列表,按顺序访问 `.pt` 嵌套字典,最终必须得到 data Tensor |
|
| 495 |
+
| `valid_ref` | 有效性所在文件;合并的数值字段必须与 data_ref 相同,媒体/JSONL 保留独立有效性文件 |
|
| 496 |
+
| `valid_key` | 非空字符串列表,最终必须得到 bool Tensor |
|
| 497 |
+
| `storage.profile` / `valid_storage.profile` | 合并字典采用 `pt/tensor_bundle/v1`;媒体及其独立有效性保持原配置,不将独立 bool Tensor 声明为 bundle |
|
| 498 |
+
|
| 499 |
+
数值字段必须显式登记 data_key 与 valid_key。例如内参登记:
|
| 500 |
+
|
| 501 |
+
```json
|
| 502 |
+
{
|
| 503 |
+
"available": true,
|
| 504 |
+
"schema_id": "camera/pinhole/v1",
|
| 505 |
+
"data_ref": "camera/camera.pt",
|
| 506 |
+
"data_key": ["intrinsic", "data"],
|
| 507 |
+
"axes": ["T", "row", "column"],
|
| 508 |
+
"valid_ref": "camera/camera.pt",
|
| 509 |
+
"valid_key": ["intrinsic", "valid"],
|
| 510 |
+
"valid_axes": ["T"],
|
| 511 |
+
"storage": {"profile": "pt/tensor_bundle/v1"},
|
| 512 |
+
"valid_storage": {"profile": "pt/tensor_bundle/v1"}
|
| 513 |
+
}
|
| 514 |
+
```
|
| 515 |
+
|
| 516 |
+
这是引用结构片段,实际组件仍须补齐 provenance、source_locator 等必填内容。MANO 的 schema_id 仍可为 `mano/axis_angle61/v1`:它描述解码后的数值语义,不因为物理文件合并而改动。顶层 schema_version 与 storage.profile 标识新的存储方式。
|
| 517 |
+
|
| 518 |
+
媒体和 JSONL 的 data_ref 不设置 data_key;RGB 的 valid_ref 仍为 `observation/rgb_valid.pt`,不设置 valid_key。分割、关系和深度的有效性同样保持原引用方式,不新增任何字典键字段。只有引用合并字典时才使用 data_key/valid_key。
|
| 519 |
+
|
| 520 |
+
同样规则适用于 attributes 中的可见性等数值字段。相机模型已有的 `distortion_ref` 改为指向 `camera/camera.pt`,新增 `distortion_key=["distortion", "data"]`;对应有效性由同组件的 `distortion_valid_ref` 与 `distortion_valid_key=["distortion", "valid"]` 登记。带 `_key` 的引用必须指向匹配的 bundle 文件,不能指向目录或媒体。
|
| 521 |
+
|
| 522 |
+
读取器按文件路径缓存已加载字典,再按 key 取字段。同一 camera.pt 的三个字段不应触发三次反序列化。按组件下载时取所需 bundle 的整个文件;本约定不承诺 `.pt` 内单个键的远端局部下载。组件合并会增加最小下载粒度,这是减少文件数的明确取舍。
|
| 523 |
+
|
| 524 |
+
### 6.5 迁移与验收
|
| 525 |
+
各数据集分别迁移:先适配工具并做代表性完整序列验证,再迁移全量并核对结果,最后按授权更新远端发布;一个数据集完成不代表其他数据集已完成。迁移状态和输入/输出固定版本逐数据集登记。
|
| 526 |
+
|
| 527 |
+
本地先在既有 `shared-v1.0` 内完成受控升级,校验完成后更名为 `shared-v1.1`。暂存、回滚、锁、旧文件清理、版本更新及 HF 路径切换遵循 [MIGRATION.md](MIGRATION.md);不复制完整媒体、不改 raw、不重新编码。多文件原地更新期间须保持维护状态,不能让读取任务使用半迁移视图。
|
| 528 |
+
|
| 529 |
+
每次迁移必须检查:
|
| 530 |
+
|
| 531 |
+
1. 所有组件、属性及其字典键可解析;无越界文件引用、缺失键或未登记字段;已合并的数值组件不得遗留旧独立 `*_valid.pt`。媒体/JSONL 的原独立有效性文件必须保留,不得误删或重打包。
|
| 532 |
+
2. 每个迁移前后的数值字段 dtype、shape、逐元素值、NaN 位置以及 bool valid 完全一致。数值张量还应按统一连续字节视图比较,确认没有更改 NaN 位串等内容;不能用近似容差代替单纯重打包的一致性。
|
| 533 |
+
3. T、帧映射、相机方向、手槽、split、来源和 valid_policy 不变。固定标定仍按既有 `[T,...]` 规则保存;本次不额外改成单份静态标定加广播。
|
| 534 |
+
4. 媒体与其他未修改文件按原可信摘要核对。新 `.pt` 的文件 SHA256 通常改变,必须重新生成发布清单;新文件指纹不等于转换语义正确性的证明。
|
| 535 |
+
5. 用新读取器运行代表性完整序列及所有相机,检查 RGB、相机与实际存在的标注是否正确关联;报告明确“重打包数值一致”与“人工视觉验收”的不同范围。
|
| 536 |
+
|
| 537 |
+
只有完成匹配注册表、读写工具及上述验收后才能生产/发布 v1.1。上传仍须单独得到授权;本文档更新本身不启动数据迁移或上传;被替代旧文件的清理属于后续迁移发布步骤,必须遵守MIGRATION.md 中先验收、安全切换和固定提交核验要求。
|
| 538 |
+
|
| 539 |
+
## 7. Dex-YCB 当前发布的文件内容
|
| 540 |
+
|
| 541 |
+
本表中的路径均相对一个视图 `data/<sequence>/<camera>/`。形状中的 T 是该视图帧数,H/W 是 RGB 逻辑尺寸;实际是否提供、文��定位及键定位始终读取 metainfo,不按目录猜测。当前发布为 exo、pinhole,固定左右手槽,原生单侧标注保存在相应槽中,另一侧无效;不生成替代手分割。
|
| 542 |
+
|
| 543 |
+
| 文件 | 字段及内容 | 解码 dtype / shape | 有效性与语义 |
|
| 544 |
+
|---|---|---|---|
|
| 545 |
+
| `metainfo.json` | 版本、视图、split、sampling、组件、来源及 MANO 模型身份 | JSON | view_type 必填;本发布 exo |
|
| 546 |
+
| `camera/frames.jsonl` | 源帧号、包成员、时间与同步映射 | 每帧一行,0..T-1 | 未知真实时间/FPS 保持 null |
|
| 547 |
+
| `observation/rgb.mkv` | 原 JPEG 码流顺序封装 | 解码 RGB uint8 `[T,H,W,3]` | `rgb_valid.pt` 为 bool `[T]`;源 JPEG 本身有损,不二次编码 |
|
| 548 |
+
| `observation/depth.mkv` | 米制相机 Z 深度的 float32 位串 | float32 `[T,H,W]` | `depth_valid.mkv` 解码 bool `[T,H,W]`;不是普通 uint16 深度 |
|
| 549 |
+
| `camera/camera.pt` | `intrinsic/data`、`extrinsic/data` | float32 `[T,3,3]`、`[T,4,4]` | 各字段 `valid` 为 bool `[T]`;K 与 T_camera_from_world |
|
| 550 |
+
| `annotation/mano/mano.pt` | `motion/data` | float32 `[T,2,61]` | `motion/valid` bool `[T,2]`;48 轴角、10 betas、3 平移 |
|
| 551 |
+
| `annotation/keypoints/keypoints.pt` | `uv/data`、`xyz/data` | float32 `[T,2,21,2]`、`[T,2,21,3]` | 各自 valid bool `[T,2,21]`;像素、米制相机系;mano21/v1 |
|
| 552 |
+
| `annotation/object/<id>/object.pt` | `pose/data` | float32 `[T,4,4]` | `pose/valid` bool `[T]`;T_camera_from_object |
|
| 553 |
+
| `annotation/object/<id>/metainfo.json`、`assets/` | YCB 身份、原 OBJ/MTL/纹理及引用 | JSON、原资产文件 | 网格米制;静态缩略图不证明 RGB 投影对齐 |
|
| 554 |
+
| `annotation/segment/mask.mkv` | 原整数区域码 | uint16 `[T,H,W]` | `mask_valid.pt` bool `[T]`;0=背景,255=原生手区域,YCB 物体号由 instances 映射 |
|
| 555 |
+
| `annotation/segment/instances.jsonl` | 每帧区域码到类别/实体的映射 | JSONL | 不从伪彩色推断原始标签,不从 255 推断解剖学左右 |
|
| 556 |
+
| `annotation/contact/relations.jsonl` | 经 ycb_ids 解析的 grasp 关系 | JSONL | `relations_valid.pt` bool `[T]`;序列级目标广播,不是逐帧接触测量 |
|
| 557 |
+
|
| 558 |
+
Dex-YCB 当前没有源可见性属性、关节物体部件状态或逐顶点接触数值时,不创建这些可选字段。一般 schema 的登记不代表该数据集实际提供。MANO 权重不随发布附带;左右模型、mean/shapedirs 状态和身份以 MANO 组件的 model_profile 为准。
|
| 559 |
+
|
| 560 |
+
## 8. 使用、追溯与验收入口
|
| 561 |
+
|
| 562 |
+
- 当前 raw 映射及未纳入项:[RAW_TO_SHARED.md](RAW_TO_SHARED.md)。
|
| 563 |
+
- 可执行读取示例与依赖:[READING.md](READING.md)。
|
| 564 |
+
- 抽样 HTML:[validation/index.html](validation/index.html)。全量迁移报告 `FULL_MIGRATION_SUMMARY.json` 与抽样报告 `validation/V1_1_VALIDATION.json` 分别说明数值一致性和抽样范围;人工只审过部分页面,不声称逐页审过全部视图。
|
| 565 |
+
- 迁移、安全切换及回滚规则:[MIGRATION.md](MIGRATION.md)。历史 v1.0 文档/报告和执行代码仅作来源证据,不能代替当前规范或重新命名为 v1.1 验收。
|
| 566 |
+
- 文档修订不改变 data、raw 或注册表定义;必须在发布提交上检查 data/raw 树标识不变,并保留被替换文档。合同与 schema 真有冲突时先核实实现和源语义,不靠改文档掩盖数据问题。
|
| 567 |
+
|
| 568 |
+
## 附录:任务范围
|
| 569 |
+
|
| 570 |
+
不强制收录 2D bbox、完整高频动捕、动作程序、身体 SMPL-X、点云或网络特征。范围内的接触、visibility、选定手关键点、物体几何不能因不便处理而静默丢弃。分割采用的物理编码由第 5.5 节决定,存在重叠时不能以单层标签图声称无损。
|
| 571 |
+
|
| 572 |
+
不设置 entities_ref/segment/entities.json,不要求与 object_id 重复的 track_id。MediaPipe 不在当前关键点定义中;旧版本迁移必须保留可追溯关系,不能直接删表。手部共享表示不含独立 hand_mesh。
|
| 573 |
+
|
| 574 |
+
schema.json 是普通注册表,不是 JSON Schema 文档或可执行验收器;定义存在不代表真实数据已验证。验收须保留实测范围与未决项。
|
| 575 |
+
|
| 576 |
+
格式定义不等于某个数据集已经验收。发布必须显式登记实际 storage;历史产物按历史定义读取,不能只改文件后缀或版本标识伪装为合规。
|
TACO/shared-v1.1/doc/RAW_TO_SHARED.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TACO shared-v1.1
|
| 2 |
+
|
| 3 |
+
Source SHA fa8ed8b4cf5d46949b90ef852128811a2854066a
|
| 4 |
+
|
| 5 |
+
The archive ZIPs and the source snapshot are in the sibling raw directory. Each view preserves full RGB presentation order, camera and triplet IDs and the official train/test subset in metadata. The marker-removed alternate is a separate view with the same physical camera ID. Use the original views for source native segmentation and the ego views for measured depth. Original 2D arrays are attached only after a per-view zero-offset moving-boundary check. Views with inconclusive or inconsistent mapping retain the original arrays in raw. Ego depth is attached only when the decoded storage precision, RGB pixel grid and frame count agree. The receipts identify depth excluded because registration or source frame correspondence could not be verified.
|
| 6 |
+
|
| 7 |
+
Bundle fields follow the declared per-view schemas. See each validation record for exact source member, pixel and timing verification, and the handling of the native 2D annotation.
|
TACO/shared-v1.1/doc/SOURCE.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"_id":"683808881e7e997dddc4b892","id":"leolyliu/TACO","author":"leolyliu","sha":"fa8ed8b4cf5d46949b90ef852128811a2854066a","lastModified":"2026-10-13T09:51:58.000Z","private":false,"gated":false,"disabled":false,"tags":["license:mit","region:us"],"description":"\n\t\n\t\t\n\t\n\t\n\t\tTACO: Benchmarking Generalizable Bimanual Tool-ACtion-Object Understanding\n\t\n\n\n\t\n\t\t\n\t\n\t\n\t\tDataset Versions\n\t\n\n\n\t\n\t\t\n\t\n\t\n\t\t[1] Pre-released Version\n\t\n\nDataset links:\n\nOneDrive: https://1drv.ms/f/s!Ap-t7dLl7BFUfmNkrHubnoo8LCs?e=1h0Xhe\nBaiduNetDisk: https://pan.baidu.com/s/1gANrhzdUyvsUGXcDB4xMfQ?pwd=kg7j\n\nDataset Contents:\n\n244 high-quality motions sequences spanning 137 <tool, action, object> triplets\n206 High-resolution object models (10K~100K faces per object mesh)\nHand-object… See the full description on the dataset page: https://huggingface.co/datasets/leolyliu/TACO.","downloads":10002,"likes":0,"cardData":{"license":"mit"},"siblings":[{"rfilename":".gitattributes","blobId":"1ef325f1b111266a6b26e0196871bd78baa8c2f3","size":2461},{"rfilename":".migration/transfer-status.json","blobId":"c758fd79d177b844cc6ba3d2fa032f887373ec1b","size":5546},{"rfilename":"2D_Segmentation.zip","blobId":"ccf27dca7039651e5016314eaa479faad8b7750b","size":2591020290,"lfs":{"sha256":"216fb8eaa5c063a4b70cdd8fdca4b4ae76bf7cf8b5268b033969a25dc5e8f0f4","size":2591020290,"pointerSize":135}},{"rfilename":"Allocentric_Camera_Parameters.zip","blobId":"08a8f1d82adab4073f778a86a63064880acb006b","size":7960127,"lfs":{"sha256":"da1d03f17edecaafa4c3e6c2ce6519798e40840b7d0dff1244cebf9cabe6baa4","size":7960127,"pointerSize":132}},{"rfilename":"Allocentric_RGB_Videos/21218078.zip","blobId":"11b9c31193724e2b0d7e0e184026cf3bb3bf9e94","size":17039802110,"lfs":{"sha256":"a8ef4f1d3dcb58f44f6bccb3257627a516d0fe0e83f23bb70bdb0cfd4342f901","size":17039802110,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22070938.zip","blobId":"972e51a723aac88c91d227edf4d7334ed01df515","size":35047668784,"lfs":{"sha256":"60289b8ac779d94a763fecf060c148689f28f1d422a69428e12dbfa26bd3b0b5","size":35047668784,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139905.zip","blobId":"7e35916a7e5daa4b7fd8abe8dfadb520a96f74b3","size":29447667841,"lfs":{"sha256":"3739f6dd0a0664f9a530e96c0862e06e4d9dbde4299c47083f6f08517c744feb","size":29447667841,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139906.zip","blobId":"3f810a67300eb030555a9ee1ba31e2d49738d44f","size":83231806783,"lfs":{"sha256":"72c65a1051fb63f8b9b2d175637fd206b25a4a978db53469221203337bf7f97d","size":83231806783,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139908.zip","blobId":"2c20bdb2f4dddc9b40f2328913b03a690077510c","size":42700141087,"lfs":{"sha256":"2656e7fc708c533e7e4ba9af96c5e7d66dfc1314b6a77df7ab6659cc410be12c","size":42700141087,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139909.zip","blobId":"fc9791a97098e11b0e0658a53e47fa694bc5116f","size":34615585912,"lfs":{"sha256":"4655b534ff04cf0fb5222af629a5990c4c3da4eab0184a2fb397f02fc3fa7975","size":34615585912,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139910.zip","blobId":"ae1cd4d6231bf4c88debcc6f4b79f8f1b93f85be","size":31624481954,"lfs":{"sha256":"b91558bbafc318ce1d59cc420f468aafd1d1211d72a8c6b067932461c5b28d61","size":31624481954,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139911.zip","blobId":"9e6092ec9fc90a74b9c1f093dd0806ee59201eb1","size":32892021668,"lfs":{"sha256":"d1db9d3794536dea450233785a230b5ea415bed31d66c4ca78b415ff09b85d6e","size":32892021668,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139913.zip","blobId":"65f22ac9cb66cc9ed9e0c439b45e3bd0dccecf9c","size":34108524276,"lfs":{"sha256":"b44085381c15055b61017323b7af746367b21edb0ef41013e3e6a4def9ece6f9","size":34108524276,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139914.zip","blobId":"2c2c4fbeab28d8c9415628f8c832012742e4c6d5","size":77244933494,"lfs":{"sha256":"dd590a87100029d1b1ddac0e222d94a301a55bd8799dce32f7e483e75028a342","size":77244933494,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139916.zip","blobId":"09eefdd0419ed71d21beb79f01aff0c2f29ceff7","size":35498720550,"lfs":{"sha256":"3594ab32bee4bdae1f947edd47aac5bc54a0cba172976d23e57a4c37a521b667","size":35498720550,"pointerSize":136}},{"rfilename":"Allocentric_RGB_Videos/22139946.zip","blobId":"b31985322cb5fdb8e8eadd8c3e563a61c00cdc33","size":30378737211,"lfs":{"sha256":"31abdfce9e83987e2237696a95fe867c188561b0917121c36be2835b04f4515d","size":30378737211,"pointerSize":136}},{"rfilename":"Egocentric_Camera_Parameters.zip","blobId":"182bfff890f9cbfd1630df2118100b1204fe06a0","size":18689683,"lfs":{"sha256":"6e03b9e54d2de0e04bb968a8ec49de65e6737b44bf9b86d6dd3f27a756c01245","size":18689683,"pointerSize":133}},{"rfilename":"Egocentric_Depth_Videos.zip","blobId":"f7b410b0cb72b507d198ddfe022a8365f68ce5d5","size":91396872846,"lfs":{"sha256":"0efc2e866a1623273f7a5ec013a4ce9ada314d07eb2b18b5b2eb78a06b1939ee","size":91396872846,"pointerSize":136}},{"rfilename":"Egocentric_RGB_Videos.zip","blobId":"fe359df16297bab8d198076a26b6b3fe6427b2f9","size":24666017548,"lfs":{"sha256":"fc2c472091bfb6a170efa681c8eab099fab4f78294ef2dace43ebcb54f618f29","size":24666017548,"pointerSize":136}},{"rfilename":"Hand_Poses.zip","blobId":"329a891fc58dfdc5f8d7b74a811608a822787822","size":15231790511,"lfs":{"sha256":"db649d185ae818e63e9f14577067c1318d0751d35b213de8a06688637a1ece51","size":15231790511,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/21218078.zip","blobId":"9ba9c5d7072ab782eda13a1c81910f61f0dca90b","size":14960890331,"lfs":{"sha256":"09a3435ebb84cb1d06b378d7b24ff4fb7ded8073a5df6d09eb3bb8db17c8e9f5","size":14960890331,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22070938.zip","blobId":"60a05341520295a332fac66e1f8b66fae87fe4f3","size":32257743559,"lfs":{"sha256":"3427c7443140408d33190c54f7a46ad328efc4c9b8d4c2bfcf8d7afa655247d6","size":32257743559,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139905.zip","blobId":"5bbd03dfbf84d51ef2276138c7c80076e3d3ca91","size":26220025944,"lfs":{"sha256":"d857467d637c0ec849f369707cc87943fee72f509f5d1b61200e439102ad85c0","size":26220025944,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139906.zip","blobId":"37fc26fc3e3f32ff1199feb21a565c938bae55e8","size":71632569141,"lfs":{"sha256":"b1ce86f279f2a4e55ebaaec0c79a6215fa06637344576c36ea92a7506bf55863","size":71632569141,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139908.zip","blobId":"4f7a26ab0176666d607e1a73dfdad6aeff1d27a1","size":37515515336,"lfs":{"sha256":"99e73de961eda7fc6adb99640b4c82e3d1723fb08ce22fdeb7a76837d90d2df1","size":37515515336,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139909.zip","blobId":"785d49eaa559156c891e184902dfa45b75d4424c","size":31006073236,"lfs":{"sha256":"963413ba1dbf16a5979772301076095e5fcc3434cd9c20431ecacdb4d4885924","size":31006073236,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139910.zip","blobId":"1581535017f6da79cb4a9e2adc7e6f16ef235a68","size":28304374164,"lfs":{"sha256":"39a51dac3f82768bb625086a66a66be974fafffda8037673ae21db302f9bde69","size":28304374164,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139911.zip","blobId":"e8c7cbeb14dcbb220428f3db82192eed8e254a0d","size":30212545565,"lfs":{"sha256":"dd7b0fb800c0bbabd98506fc9651d622965caad12ef5374e8d826232d07703b6","size":30212545565,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139913.zip","blobId":"e7b1c18659f0866cefe200a529c81970bc4eceb7","size":31348128553,"lfs":{"sha256":"004dca1ebb82a7e5d4e95fb97024e8245e97f235b27a0e9d0c7e02eb7695dfcd","size":31348128553,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139914.zip","blobId":"75ceecfe11887ed7e5056262c5832e1fd408c652","size":66048600946,"lfs":{"sha256":"d322088ebd9d4d42fc4c6d1c729afa0977ba4682c66b4c807000f2d5c80db0b6","size":66048600946,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139916.zip","blobId":"06205bac3493e8d0517b991ba543dd0f09897a55","size":31945991282,"lfs":{"sha256":"43138a47144fc914c6fadf76b00f108c8e26f4f56e9430f322ad4ab034363cf5","size":31945991282,"pointerSize":136}},{"rfilename":"Marker_Removed_Allocentric_RGB_Videos/22139946.zip","blobId":"0382503589dc7cd6712de7c704c9aaa60fdae0a1","size":27636426386,"lfs":{"sha256":"eff24e4bf941da9c68c686b2c3b81b9179804cdcb7a6e25d0ce7ad9160efd1b5","size":27636426386,"pointerSize":136}},{"rfilename":"Object_Models.zip","blobId":"0343a88cc9284186afdf3b718fdaee126076cead","size":424209827,"lfs":{"sha256":"7b5209c7e856246cf20b379a599d756d18e8bbbbf7820bf9fe48a334f9a06cfe","size":424209827,"pointerSize":134}},{"rfilename":"Object_Poses.zip","blobId":"1ea275ae66f085b697b357150ae3238aa2ef34e6","size":34340303,"lfs":{"sha256":"39c0478395529b550fd218fdbcb9d0c866282c4dfc0d5bac1116461b85e91b64","size":34340303,"pointerSize":133}},{"rfilename":"README.md","blobId":"1c68bcfbf44a9926a79d5ada7320d876620b67eb","size":1301}],"createdAt":"2025-05-29T07:11:04.000Z","usedStorage":1047289877248}
|
TACO/shared-v1.1/doc/VALIDATION.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"depth_status": {
|
| 3 |
+
"verified": 2209,
|
| 4 |
+
"unregistered_grid_or_precision": 3
|
| 5 |
+
},
|
| 6 |
+
"native_mask_status": {
|
| 7 |
+
"verified": 20277,
|
| 8 |
+
"not_verified": 7239,
|
| 9 |
+
"source_shape_or_type_mismatch": 288
|
| 10 |
+
},
|
| 11 |
+
"status": "passed",
|
| 12 |
+
"phase": "full",
|
| 13 |
+
"dataset": "TACO",
|
| 14 |
+
"release": "shared-v1.1",
|
| 15 |
+
"revision": "fa8ed8b4cf5d46949b90ef852128811a2854066a",
|
| 16 |
+
"views": 55456,
|
| 17 |
+
"frames": 8664054,
|
| 18 |
+
"views_by_variant": {
|
| 19 |
+
"exo": 27804,
|
| 20 |
+
"marker_removed": 25440,
|
| 21 |
+
"ego": 2212
|
| 22 |
+
},
|
| 23 |
+
"frames_by_variant": {
|
| 24 |
+
"exo": 4358376,
|
| 25 |
+
"ego": 340434,
|
| 26 |
+
"marker_removed": 3965244
|
| 27 |
+
},
|
| 28 |
+
"video_archives": [
|
| 29 |
+
"Allocentric_RGB_Videos/21218078.zip",
|
| 30 |
+
"Allocentric_RGB_Videos/22070938.zip",
|
| 31 |
+
"Allocentric_RGB_Videos/22139905.zip",
|
| 32 |
+
"Allocentric_RGB_Videos/22139906.zip",
|
| 33 |
+
"Allocentric_RGB_Videos/22139908.zip",
|
| 34 |
+
"Allocentric_RGB_Videos/22139909.zip",
|
| 35 |
+
"Allocentric_RGB_Videos/22139910.zip",
|
| 36 |
+
"Allocentric_RGB_Videos/22139911.zip",
|
| 37 |
+
"Allocentric_RGB_Videos/22139913.zip",
|
| 38 |
+
"Allocentric_RGB_Videos/22139914.zip",
|
| 39 |
+
"Allocentric_RGB_Videos/22139916.zip",
|
| 40 |
+
"Allocentric_RGB_Videos/22139946.zip",
|
| 41 |
+
"Egocentric_RGB_Videos.zip",
|
| 42 |
+
"Marker_Removed_Allocentric_RGB_Videos/21218078.zip",
|
| 43 |
+
"Marker_Removed_Allocentric_RGB_Videos/22070938.zip",
|
| 44 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139905.zip",
|
| 45 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139906.zip",
|
| 46 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139908.zip",
|
| 47 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139909.zip",
|
| 48 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139910.zip",
|
| 49 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139911.zip",
|
| 50 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139913.zip",
|
| 51 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139914.zip",
|
| 52 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139916.zip",
|
| 53 |
+
"Marker_Removed_Allocentric_RGB_Videos/22139946.zip"
|
| 54 |
+
],
|
| 55 |
+
"archive_only_video_members": 99,
|
| 56 |
+
"seconds": 20570.74,
|
| 57 |
+
"check_references": {
|
| 58 |
+
"views": 55456,
|
| 59 |
+
"components": 577046,
|
| 60 |
+
"bundles": 388192,
|
| 61 |
+
"media": 188854
|
| 62 |
+
},
|
| 63 |
+
"check_conformance": {
|
| 64 |
+
"views": 55456,
|
| 65 |
+
"components": 577046,
|
| 66 |
+
"entries": 388192
|
| 67 |
+
}
|
| 68 |
+
}
|
TACO/shared-v1.1/doc/VIEW_MANIFEST.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:727facb973d8aefe03ccc4c0fd7f89001bec05493eb3f8803f669ab59f7b5f12
|
| 3 |
+
size 183400235
|
TACO/shared-v1.1/doc/schema.json
ADDED
|
@@ -0,0 +1,1590 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": "hand-warehouse/1.1",
|
| 3 |
+
"validity_revision": "usable-annotation-2026-09-20",
|
| 4 |
+
"annotation_validity": {
|
| 5 |
+
"meaning": "annotation usable for supervision, not merely record presence",
|
| 6 |
+
"formula": "source_annotation_present AND numerical_checks_pass AND applicable_official_QA_pass AND NOT explicitly_reviewed_local_exclusion",
|
| 7 |
+
"without_official_qa": "omit QA term; declare source rules; do not fabricate QA",
|
| 8 |
+
"policy_field": "components.<name>.valid_policy",
|
| 9 |
+
"visibility_is_independent": true,
|
| 10 |
+
"invalid_float_value": "NaN",
|
| 11 |
+
"hot3d": "broadcast per-camera frame manual QA conservatively to hand/object labels and pose-derived visibility; retain RGB and source calibration; keep native QA in raw and review report",
|
| 12 |
+
"hot3d_visibility": "native visibility_ratio[%] already ranges from 0 to 1; do not divide by 100"
|
| 13 |
+
},
|
| 14 |
+
"hand_slots": [
|
| 15 |
+
"left",
|
| 16 |
+
"right"
|
| 17 |
+
],
|
| 18 |
+
"view_metadata": {
|
| 19 |
+
"required_fields": [
|
| 20 |
+
"schema_version",
|
| 21 |
+
"dataset_id",
|
| 22 |
+
"release_id",
|
| 23 |
+
"sequence_id",
|
| 24 |
+
"camera_id",
|
| 25 |
+
"sample_type",
|
| 26 |
+
"num_frames",
|
| 27 |
+
"hand_slots",
|
| 28 |
+
"sampling",
|
| 29 |
+
"camera",
|
| 30 |
+
"components",
|
| 31 |
+
"split",
|
| 32 |
+
"view_type"
|
| 33 |
+
],
|
| 34 |
+
"view_type_values": [
|
| 35 |
+
"ego",
|
| 36 |
+
"exo",
|
| 37 |
+
"unknown"
|
| 38 |
+
],
|
| 39 |
+
"view_type_policy": "required per camera view; use ego or exo whenever the source data or capture setup establishes the viewpoint; use unknown only when no trustworthy source determines it; never omit or guess",
|
| 40 |
+
"schema_version": "hand-warehouse/1.1",
|
| 41 |
+
"release_id": "shared-v1.1"
|
| 42 |
+
},
|
| 43 |
+
"keypoints": {
|
| 44 |
+
"mano21/v1": {
|
| 45 |
+
"count": 21,
|
| 46 |
+
"names": [
|
| 47 |
+
"wrist",
|
| 48 |
+
"thumb_1",
|
| 49 |
+
"thumb_2",
|
| 50 |
+
"thumb_3",
|
| 51 |
+
"thumb_4",
|
| 52 |
+
"index_1",
|
| 53 |
+
"index_2",
|
| 54 |
+
"index_3",
|
| 55 |
+
"index_4",
|
| 56 |
+
"middle_1",
|
| 57 |
+
"middle_2",
|
| 58 |
+
"middle_3",
|
| 59 |
+
"middle_4",
|
| 60 |
+
"ring_1",
|
| 61 |
+
"ring_2",
|
| 62 |
+
"ring_3",
|
| 63 |
+
"ring_4",
|
| 64 |
+
"little_1",
|
| 65 |
+
"little_2",
|
| 66 |
+
"little_3",
|
| 67 |
+
"little_4"
|
| 68 |
+
],
|
| 69 |
+
"source_index_map": null,
|
| 70 |
+
"note": "adapter maps official MANO joint and fingertip convention"
|
| 71 |
+
},
|
| 72 |
+
"rhd21/v1": {
|
| 73 |
+
"count": 21,
|
| 74 |
+
"names": [
|
| 75 |
+
"wrist",
|
| 76 |
+
"thumb_1",
|
| 77 |
+
"thumb_2",
|
| 78 |
+
"thumb_3",
|
| 79 |
+
"thumb_4",
|
| 80 |
+
"index_1",
|
| 81 |
+
"index_2",
|
| 82 |
+
"index_3",
|
| 83 |
+
"index_4",
|
| 84 |
+
"middle_1",
|
| 85 |
+
"middle_2",
|
| 86 |
+
"middle_3",
|
| 87 |
+
"middle_4",
|
| 88 |
+
"ring_1",
|
| 89 |
+
"ring_2",
|
| 90 |
+
"ring_3",
|
| 91 |
+
"ring_4",
|
| 92 |
+
"little_1",
|
| 93 |
+
"little_2",
|
| 94 |
+
"little_3",
|
| 95 |
+
"little_4"
|
| 96 |
+
],
|
| 97 |
+
"source_index_map_per_hand": [
|
| 98 |
+
0,
|
| 99 |
+
4,
|
| 100 |
+
3,
|
| 101 |
+
2,
|
| 102 |
+
1,
|
| 103 |
+
8,
|
| 104 |
+
7,
|
| 105 |
+
6,
|
| 106 |
+
5,
|
| 107 |
+
12,
|
| 108 |
+
11,
|
| 109 |
+
10,
|
| 110 |
+
9,
|
| 111 |
+
16,
|
| 112 |
+
15,
|
| 113 |
+
14,
|
| 114 |
+
13,
|
| 115 |
+
20,
|
| 116 |
+
19,
|
| 117 |
+
18,
|
| 118 |
+
17
|
| 119 |
+
]
|
| 120 |
+
}
|
| 121 |
+
},
|
| 122 |
+
"camera": {
|
| 123 |
+
"opencv_fisheye4": {
|
| 124 |
+
"K": [
|
| 125 |
+
3,
|
| 126 |
+
3
|
| 127 |
+
],
|
| 128 |
+
"distortion": [
|
| 129 |
+
"k1",
|
| 130 |
+
"k2",
|
| 131 |
+
"k3",
|
| 132 |
+
"k4"
|
| 133 |
+
],
|
| 134 |
+
"projection": "theta=atan(r); theta_d=theta*(1+k1*theta^2+k2*theta^4+k3*theta^6+k4*theta^8); source ReInterHand"
|
| 135 |
+
},
|
| 136 |
+
"pinhole": {
|
| 137 |
+
"K": [
|
| 138 |
+
3,
|
| 139 |
+
3
|
| 140 |
+
]
|
| 141 |
+
},
|
| 142 |
+
"fisheye624": {
|
| 143 |
+
"parameters": [
|
| 144 |
+
"f",
|
| 145 |
+
"cx",
|
| 146 |
+
"cy",
|
| 147 |
+
"k0",
|
| 148 |
+
"k1",
|
| 149 |
+
"k2",
|
| 150 |
+
"k3",
|
| 151 |
+
"k4",
|
| 152 |
+
"k5",
|
| 153 |
+
"p0",
|
| 154 |
+
"p1",
|
| 155 |
+
"s0",
|
| 156 |
+
"s1",
|
| 157 |
+
"s2",
|
| 158 |
+
"s3"
|
| 159 |
+
]
|
| 160 |
+
},
|
| 161 |
+
"rational8": {
|
| 162 |
+
"K": [
|
| 163 |
+
3,
|
| 164 |
+
3
|
| 165 |
+
],
|
| 166 |
+
"distortion": [
|
| 167 |
+
"k1",
|
| 168 |
+
"k2",
|
| 169 |
+
"p1",
|
| 170 |
+
"p2",
|
| 171 |
+
"k3",
|
| 172 |
+
"k4",
|
| 173 |
+
"k5",
|
| 174 |
+
"k6"
|
| 175 |
+
]
|
| 176 |
+
}
|
| 177 |
+
},
|
| 178 |
+
"segmentation": {
|
| 179 |
+
"segment/uint16_labels/v1": {
|
| 180 |
+
"storage": "mask.mkv",
|
| 181 |
+
"dtype": "uint16",
|
| 182 |
+
"mapping": "instances.jsonl",
|
| 183 |
+
"valid_shape": [
|
| 184 |
+
"T"
|
| 185 |
+
],
|
| 186 |
+
"required_metadata": [
|
| 187 |
+
"segmentation_type",
|
| 188 |
+
"coverage",
|
| 189 |
+
"mapping_ref",
|
| 190 |
+
"storage"
|
| 191 |
+
],
|
| 192 |
+
"shape": [
|
| 193 |
+
"T",
|
| 194 |
+
"H",
|
| 195 |
+
"W"
|
| 196 |
+
],
|
| 197 |
+
"reserved_codes": {
|
| 198 |
+
"0": "unassigned",
|
| 199 |
+
"65535": "ignore"
|
| 200 |
+
},
|
| 201 |
+
"region_codes": [
|
| 202 |
+
1,
|
| 203 |
+
65534
|
| 204 |
+
],
|
| 205 |
+
"allowed_storage_profiles": [
|
| 206 |
+
"mkv/uint16_ffv1/v1"
|
| 207 |
+
]
|
| 208 |
+
},
|
| 209 |
+
"segment/instance_polygons/v1": {
|
| 210 |
+
"storage": "polygons.jsonl",
|
| 211 |
+
"mapping": "instances.jsonl",
|
| 212 |
+
"frame_keys": [
|
| 213 |
+
"frame_index",
|
| 214 |
+
"instances"
|
| 215 |
+
],
|
| 216 |
+
"instance_keys": [
|
| 217 |
+
"mask_value",
|
| 218 |
+
"polygons"
|
| 219 |
+
],
|
| 220 |
+
"coordinate_unit": "pixel",
|
| 221 |
+
"overlap_allowed": true,
|
| 222 |
+
"valid_shape": [
|
| 223 |
+
"T"
|
| 224 |
+
],
|
| 225 |
+
"required_metadata": [
|
| 226 |
+
"segmentation_type",
|
| 227 |
+
"coverage",
|
| 228 |
+
"mapping_ref"
|
| 229 |
+
],
|
| 230 |
+
"polygon_shape": [
|
| 231 |
+
"N",
|
| 232 |
+
2
|
| 233 |
+
],
|
| 234 |
+
"holes_supported": false
|
| 235 |
+
},
|
| 236 |
+
"segment/foreground_intensity/v1": {
|
| 237 |
+
"storage": "mask.mkv",
|
| 238 |
+
"dtype": "uint16",
|
| 239 |
+
"value_range": [
|
| 240 |
+
0,
|
| 241 |
+
255
|
| 242 |
+
],
|
| 243 |
+
"normalization_scale": 0.00392156862745098,
|
| 244 |
+
"axes": [
|
| 245 |
+
"T",
|
| 246 |
+
"height",
|
| 247 |
+
"width"
|
| 248 |
+
],
|
| 249 |
+
"meaning": "native hand foreground intensity; individual hand or union declared in metadata; not instance codes or calibrated probability",
|
| 250 |
+
"zero": "background",
|
| 251 |
+
"full_scale": "foreground",
|
| 252 |
+
"mapping": "foreground_category in component metadata",
|
| 253 |
+
"valid_shape": [
|
| 254 |
+
"T"
|
| 255 |
+
],
|
| 256 |
+
"required_metadata": [
|
| 257 |
+
"segmentation_type",
|
| 258 |
+
"coverage",
|
| 259 |
+
"value_range",
|
| 260 |
+
"normalization_scale",
|
| 261 |
+
"foreground_category",
|
| 262 |
+
"entity_id",
|
| 263 |
+
"storage"
|
| 264 |
+
],
|
| 265 |
+
"shape": [
|
| 266 |
+
"T",
|
| 267 |
+
"H",
|
| 268 |
+
"W"
|
| 269 |
+
],
|
| 270 |
+
"allowed_storage_profiles": [
|
| 271 |
+
"mkv/uint16_ffv1/v1"
|
| 272 |
+
]
|
| 273 |
+
}
|
| 274 |
+
},
|
| 275 |
+
"note": "Registry for hand-warehouse/1.1. Read CONTRACT.md and MIGRATION.md. This is a declarative registry, not a JSON Schema document or executable validator. Runtime readers/converters/validators still require adaptation.",
|
| 276 |
+
"components": {
|
| 277 |
+
"mano/axis_angle61/v1": {
|
| 278 |
+
"storage": "pt",
|
| 279 |
+
"dtype": "float32",
|
| 280 |
+
"shape": [
|
| 281 |
+
"T",
|
| 282 |
+
2,
|
| 283 |
+
61
|
| 284 |
+
],
|
| 285 |
+
"valid_shape": [
|
| 286 |
+
"T",
|
| 287 |
+
2
|
| 288 |
+
],
|
| 289 |
+
"unit": "m",
|
| 290 |
+
"angle_unit": "rad",
|
| 291 |
+
"coordinate_frame": "camera",
|
| 292 |
+
"layout": {
|
| 293 |
+
"pose_axis_angle": [
|
| 294 |
+
0,
|
| 295 |
+
48
|
| 296 |
+
],
|
| 297 |
+
"shape": [
|
| 298 |
+
48,
|
| 299 |
+
58
|
| 300 |
+
],
|
| 301 |
+
"translation": [
|
| 302 |
+
58,
|
| 303 |
+
61
|
| 304 |
+
]
|
| 305 |
+
},
|
| 306 |
+
"allowed_storage_profiles": [
|
| 307 |
+
"pt/tensor_bundle/v1"
|
| 308 |
+
],
|
| 309 |
+
"allowed_valid_storage_profiles": [
|
| 310 |
+
"pt/tensor_bundle/v1"
|
| 311 |
+
],
|
| 312 |
+
"valid_storage": "pt",
|
| 313 |
+
"tensor_container": "dict",
|
| 314 |
+
"valid_dtype": "bool",
|
| 315 |
+
"required_metadata": [
|
| 316 |
+
"data_ref",
|
| 317 |
+
"data_key",
|
| 318 |
+
"valid_ref",
|
| 319 |
+
"valid_key",
|
| 320 |
+
"storage",
|
| 321 |
+
"valid_storage"
|
| 322 |
+
]
|
| 323 |
+
},
|
| 324 |
+
"keypoints/uv/v1": {
|
| 325 |
+
"storage": "pt",
|
| 326 |
+
"dtype": "float32",
|
| 327 |
+
"shape": [
|
| 328 |
+
"T",
|
| 329 |
+
2,
|
| 330 |
+
21,
|
| 331 |
+
2
|
| 332 |
+
],
|
| 333 |
+
"valid_shape": [
|
| 334 |
+
"T",
|
| 335 |
+
2,
|
| 336 |
+
21
|
| 337 |
+
],
|
| 338 |
+
"unit": "pixel",
|
| 339 |
+
"required_metadata": [
|
| 340 |
+
"keypoint_schema",
|
| 341 |
+
"data_ref",
|
| 342 |
+
"data_key",
|
| 343 |
+
"valid_ref",
|
| 344 |
+
"valid_key",
|
| 345 |
+
"storage",
|
| 346 |
+
"valid_storage"
|
| 347 |
+
],
|
| 348 |
+
"allowed_storage_profiles": [
|
| 349 |
+
"pt/tensor_bundle/v1"
|
| 350 |
+
],
|
| 351 |
+
"allowed_valid_storage_profiles": [
|
| 352 |
+
"pt/tensor_bundle/v1"
|
| 353 |
+
],
|
| 354 |
+
"valid_storage": "pt",
|
| 355 |
+
"tensor_container": "dict",
|
| 356 |
+
"valid_dtype": "bool"
|
| 357 |
+
},
|
| 358 |
+
"keypoints/xyz/v1": {
|
| 359 |
+
"storage": "pt",
|
| 360 |
+
"dtype": "float32",
|
| 361 |
+
"shape": [
|
| 362 |
+
"T",
|
| 363 |
+
2,
|
| 364 |
+
21,
|
| 365 |
+
3
|
| 366 |
+
],
|
| 367 |
+
"valid_shape": [
|
| 368 |
+
"T",
|
| 369 |
+
2,
|
| 370 |
+
21
|
| 371 |
+
],
|
| 372 |
+
"unit": "m",
|
| 373 |
+
"required_metadata": [
|
| 374 |
+
"keypoint_schema",
|
| 375 |
+
"data_ref",
|
| 376 |
+
"data_key",
|
| 377 |
+
"valid_ref",
|
| 378 |
+
"valid_key",
|
| 379 |
+
"storage",
|
| 380 |
+
"valid_storage"
|
| 381 |
+
],
|
| 382 |
+
"allowed_storage_profiles": [
|
| 383 |
+
"pt/tensor_bundle/v1"
|
| 384 |
+
],
|
| 385 |
+
"allowed_valid_storage_profiles": [
|
| 386 |
+
"pt/tensor_bundle/v1"
|
| 387 |
+
],
|
| 388 |
+
"valid_storage": "pt",
|
| 389 |
+
"tensor_container": "dict",
|
| 390 |
+
"valid_dtype": "bool"
|
| 391 |
+
},
|
| 392 |
+
"depth/z_float32/v1": {
|
| 393 |
+
"storage": "mkv",
|
| 394 |
+
"dtype": "float32",
|
| 395 |
+
"shape": [
|
| 396 |
+
"T",
|
| 397 |
+
"H",
|
| 398 |
+
"W"
|
| 399 |
+
],
|
| 400 |
+
"valid_shape": [
|
| 401 |
+
"T",
|
| 402 |
+
"H",
|
| 403 |
+
"W"
|
| 404 |
+
],
|
| 405 |
+
"unit": "m",
|
| 406 |
+
"depth_type": "z",
|
| 407 |
+
"pixel_grid": "current_rgb",
|
| 408 |
+
"coordinate_frame": "current_rgb_camera",
|
| 409 |
+
"valid_storage": "mkv",
|
| 410 |
+
"allowed_storage_profiles": [
|
| 411 |
+
"mkv/depth_float32_bits/v1"
|
| 412 |
+
],
|
| 413 |
+
"allowed_valid_storage_profiles": [
|
| 414 |
+
"mkv/bool_ffv1/v1"
|
| 415 |
+
],
|
| 416 |
+
"required_metadata": [
|
| 417 |
+
"storage",
|
| 418 |
+
"valid_storage",
|
| 419 |
+
"depth_origin"
|
| 420 |
+
],
|
| 421 |
+
"depth_origin_values": [
|
| 422 |
+
"measured",
|
| 423 |
+
"rendered",
|
| 424 |
+
"unknown"
|
| 425 |
+
]
|
| 426 |
+
},
|
| 427 |
+
"transform/se3/v1": {
|
| 428 |
+
"storage": "pt",
|
| 429 |
+
"dtype": "float32",
|
| 430 |
+
"shape": [
|
| 431 |
+
"T",
|
| 432 |
+
4,
|
| 433 |
+
4
|
| 434 |
+
],
|
| 435 |
+
"valid_shape": [
|
| 436 |
+
"T"
|
| 437 |
+
],
|
| 438 |
+
"unit": "m",
|
| 439 |
+
"required_metadata": [
|
| 440 |
+
"convention",
|
| 441 |
+
"data_ref",
|
| 442 |
+
"data_key",
|
| 443 |
+
"valid_ref",
|
| 444 |
+
"valid_key",
|
| 445 |
+
"storage",
|
| 446 |
+
"valid_storage"
|
| 447 |
+
],
|
| 448 |
+
"allowed_storage_profiles": [
|
| 449 |
+
"pt/tensor_bundle/v1"
|
| 450 |
+
],
|
| 451 |
+
"allowed_valid_storage_profiles": [
|
| 452 |
+
"pt/tensor_bundle/v1"
|
| 453 |
+
],
|
| 454 |
+
"valid_storage": "pt",
|
| 455 |
+
"tensor_container": "dict",
|
| 456 |
+
"valid_dtype": "bool"
|
| 457 |
+
},
|
| 458 |
+
"object/rigid/v1": {
|
| 459 |
+
"storage": "pt",
|
| 460 |
+
"dtype": "float32",
|
| 461 |
+
"shape": [
|
| 462 |
+
"T",
|
| 463 |
+
4,
|
| 464 |
+
4
|
| 465 |
+
],
|
| 466 |
+
"valid_shape": [
|
| 467 |
+
"T"
|
| 468 |
+
],
|
| 469 |
+
"unit": "m",
|
| 470 |
+
"required_metadata": [
|
| 471 |
+
"convention",
|
| 472 |
+
"data_ref",
|
| 473 |
+
"data_key",
|
| 474 |
+
"valid_ref",
|
| 475 |
+
"valid_key",
|
| 476 |
+
"storage",
|
| 477 |
+
"valid_storage"
|
| 478 |
+
],
|
| 479 |
+
"allowed_storage_profiles": [
|
| 480 |
+
"pt/tensor_bundle/v1"
|
| 481 |
+
],
|
| 482 |
+
"allowed_valid_storage_profiles": [
|
| 483 |
+
"pt/tensor_bundle/v1"
|
| 484 |
+
],
|
| 485 |
+
"valid_storage": "pt",
|
| 486 |
+
"tensor_container": "dict",
|
| 487 |
+
"valid_dtype": "bool"
|
| 488 |
+
},
|
| 489 |
+
"camera/pinhole/v1": {
|
| 490 |
+
"storage": "pt",
|
| 491 |
+
"dtype": "float32",
|
| 492 |
+
"shape": [
|
| 493 |
+
"T",
|
| 494 |
+
3,
|
| 495 |
+
3
|
| 496 |
+
],
|
| 497 |
+
"valid_shape": [
|
| 498 |
+
"T"
|
| 499 |
+
],
|
| 500 |
+
"allowed_storage_profiles": [
|
| 501 |
+
"pt/tensor_bundle/v1"
|
| 502 |
+
],
|
| 503 |
+
"allowed_valid_storage_profiles": [
|
| 504 |
+
"pt/tensor_bundle/v1"
|
| 505 |
+
],
|
| 506 |
+
"valid_storage": "pt",
|
| 507 |
+
"tensor_container": "dict",
|
| 508 |
+
"valid_dtype": "bool",
|
| 509 |
+
"required_metadata": [
|
| 510 |
+
"data_ref",
|
| 511 |
+
"data_key",
|
| 512 |
+
"valid_ref",
|
| 513 |
+
"valid_key",
|
| 514 |
+
"storage",
|
| 515 |
+
"valid_storage"
|
| 516 |
+
]
|
| 517 |
+
},
|
| 518 |
+
"camera/rational8/v1": {
|
| 519 |
+
"storage": "pt",
|
| 520 |
+
"dtype": "float32",
|
| 521 |
+
"shape": [
|
| 522 |
+
"T",
|
| 523 |
+
3,
|
| 524 |
+
3
|
| 525 |
+
],
|
| 526 |
+
"valid_shape": [
|
| 527 |
+
"T"
|
| 528 |
+
],
|
| 529 |
+
"allowed_storage_profiles": [
|
| 530 |
+
"pt/tensor_bundle/v1"
|
| 531 |
+
],
|
| 532 |
+
"allowed_valid_storage_profiles": [
|
| 533 |
+
"pt/tensor_bundle/v1"
|
| 534 |
+
],
|
| 535 |
+
"valid_storage": "pt",
|
| 536 |
+
"tensor_container": "dict",
|
| 537 |
+
"valid_dtype": "bool",
|
| 538 |
+
"required_metadata": [
|
| 539 |
+
"data_ref",
|
| 540 |
+
"data_key",
|
| 541 |
+
"valid_ref",
|
| 542 |
+
"valid_key",
|
| 543 |
+
"storage",
|
| 544 |
+
"valid_storage",
|
| 545 |
+
"distortion_ref",
|
| 546 |
+
"distortion_key",
|
| 547 |
+
"distortion_valid_ref",
|
| 548 |
+
"distortion_valid_key"
|
| 549 |
+
]
|
| 550 |
+
},
|
| 551 |
+
"camera/opencv_fisheye4/v1": {
|
| 552 |
+
"storage": "pt",
|
| 553 |
+
"dtype": "float32",
|
| 554 |
+
"shape": [
|
| 555 |
+
"T",
|
| 556 |
+
3,
|
| 557 |
+
3
|
| 558 |
+
],
|
| 559 |
+
"valid_shape": [
|
| 560 |
+
"T"
|
| 561 |
+
],
|
| 562 |
+
"allowed_storage_profiles": [
|
| 563 |
+
"pt/tensor_bundle/v1"
|
| 564 |
+
],
|
| 565 |
+
"allowed_valid_storage_profiles": [
|
| 566 |
+
"pt/tensor_bundle/v1"
|
| 567 |
+
],
|
| 568 |
+
"valid_storage": "pt",
|
| 569 |
+
"tensor_container": "dict",
|
| 570 |
+
"valid_dtype": "bool",
|
| 571 |
+
"required_metadata": [
|
| 572 |
+
"data_ref",
|
| 573 |
+
"data_key",
|
| 574 |
+
"valid_ref",
|
| 575 |
+
"valid_key",
|
| 576 |
+
"storage",
|
| 577 |
+
"valid_storage",
|
| 578 |
+
"distortion_ref",
|
| 579 |
+
"distortion_key",
|
| 580 |
+
"distortion_valid_ref",
|
| 581 |
+
"distortion_valid_key"
|
| 582 |
+
]
|
| 583 |
+
},
|
| 584 |
+
"camera/fisheye624/v1": {
|
| 585 |
+
"storage": "pt",
|
| 586 |
+
"dtype": "float32",
|
| 587 |
+
"shape": [
|
| 588 |
+
"T",
|
| 589 |
+
15
|
| 590 |
+
],
|
| 591 |
+
"valid_shape": [
|
| 592 |
+
"T"
|
| 593 |
+
],
|
| 594 |
+
"allowed_storage_profiles": [
|
| 595 |
+
"pt/tensor_bundle/v1"
|
| 596 |
+
],
|
| 597 |
+
"allowed_valid_storage_profiles": [
|
| 598 |
+
"pt/tensor_bundle/v1"
|
| 599 |
+
],
|
| 600 |
+
"valid_storage": "pt",
|
| 601 |
+
"tensor_container": "dict",
|
| 602 |
+
"valid_dtype": "bool",
|
| 603 |
+
"required_metadata": [
|
| 604 |
+
"data_ref",
|
| 605 |
+
"data_key",
|
| 606 |
+
"valid_ref",
|
| 607 |
+
"valid_key",
|
| 608 |
+
"storage",
|
| 609 |
+
"valid_storage"
|
| 610 |
+
]
|
| 611 |
+
},
|
| 612 |
+
"camera/distortion8/v1": {
|
| 613 |
+
"storage": "pt",
|
| 614 |
+
"dtype": "float32",
|
| 615 |
+
"shape": [
|
| 616 |
+
"T",
|
| 617 |
+
8
|
| 618 |
+
],
|
| 619 |
+
"valid_shape": [
|
| 620 |
+
"T"
|
| 621 |
+
],
|
| 622 |
+
"allowed_storage_profiles": [
|
| 623 |
+
"pt/tensor_bundle/v1"
|
| 624 |
+
],
|
| 625 |
+
"allowed_valid_storage_profiles": [
|
| 626 |
+
"pt/tensor_bundle/v1"
|
| 627 |
+
],
|
| 628 |
+
"valid_storage": "pt",
|
| 629 |
+
"tensor_container": "dict",
|
| 630 |
+
"valid_dtype": "bool",
|
| 631 |
+
"required_metadata": [
|
| 632 |
+
"data_ref",
|
| 633 |
+
"data_key",
|
| 634 |
+
"valid_ref",
|
| 635 |
+
"valid_key",
|
| 636 |
+
"storage",
|
| 637 |
+
"valid_storage"
|
| 638 |
+
]
|
| 639 |
+
},
|
| 640 |
+
"camera/fisheye4_distortion/v1": {
|
| 641 |
+
"storage": "pt",
|
| 642 |
+
"dtype": "float32",
|
| 643 |
+
"shape": [
|
| 644 |
+
"T",
|
| 645 |
+
4
|
| 646 |
+
],
|
| 647 |
+
"valid_shape": [
|
| 648 |
+
"T"
|
| 649 |
+
],
|
| 650 |
+
"allowed_storage_profiles": [
|
| 651 |
+
"pt/tensor_bundle/v1"
|
| 652 |
+
],
|
| 653 |
+
"allowed_valid_storage_profiles": [
|
| 654 |
+
"pt/tensor_bundle/v1"
|
| 655 |
+
],
|
| 656 |
+
"valid_storage": "pt",
|
| 657 |
+
"tensor_container": "dict",
|
| 658 |
+
"valid_dtype": "bool",
|
| 659 |
+
"required_metadata": [
|
| 660 |
+
"data_ref",
|
| 661 |
+
"data_key",
|
| 662 |
+
"valid_ref",
|
| 663 |
+
"valid_key",
|
| 664 |
+
"storage",
|
| 665 |
+
"valid_storage"
|
| 666 |
+
]
|
| 667 |
+
},
|
| 668 |
+
"object/joint_state/v1": {
|
| 669 |
+
"storage": "pt",
|
| 670 |
+
"dtype": "float32",
|
| 671 |
+
"shape": [
|
| 672 |
+
"T",
|
| 673 |
+
"J"
|
| 674 |
+
],
|
| 675 |
+
"valid_shape": [
|
| 676 |
+
"T",
|
| 677 |
+
"J"
|
| 678 |
+
],
|
| 679 |
+
"required_metadata": [
|
| 680 |
+
"joint_order",
|
| 681 |
+
"data_ref",
|
| 682 |
+
"data_key",
|
| 683 |
+
"valid_ref",
|
| 684 |
+
"valid_key",
|
| 685 |
+
"storage",
|
| 686 |
+
"valid_storage"
|
| 687 |
+
],
|
| 688 |
+
"unit_rule": "revolute radians; prismatic metres; mixed types declared per joint",
|
| 689 |
+
"allowed_storage_profiles": [
|
| 690 |
+
"pt/tensor_bundle/v1"
|
| 691 |
+
],
|
| 692 |
+
"allowed_valid_storage_profiles": [
|
| 693 |
+
"pt/tensor_bundle/v1"
|
| 694 |
+
],
|
| 695 |
+
"valid_storage": "pt",
|
| 696 |
+
"tensor_container": "dict",
|
| 697 |
+
"valid_dtype": "bool"
|
| 698 |
+
},
|
| 699 |
+
"object_keypoints/camera/v1": {
|
| 700 |
+
"storage": "pt",
|
| 701 |
+
"dtype": "float32",
|
| 702 |
+
"shape": [
|
| 703 |
+
"T",
|
| 704 |
+
"K",
|
| 705 |
+
3
|
| 706 |
+
],
|
| 707 |
+
"valid_shape": [
|
| 708 |
+
"T",
|
| 709 |
+
"K"
|
| 710 |
+
],
|
| 711 |
+
"unit": "m",
|
| 712 |
+
"coordinate_frame": "camera",
|
| 713 |
+
"required_metadata": [
|
| 714 |
+
"keypoint_schema",
|
| 715 |
+
"data_ref",
|
| 716 |
+
"data_key",
|
| 717 |
+
"valid_ref",
|
| 718 |
+
"valid_key",
|
| 719 |
+
"storage",
|
| 720 |
+
"valid_storage"
|
| 721 |
+
],
|
| 722 |
+
"allowed_storage_profiles": [
|
| 723 |
+
"pt/tensor_bundle/v1"
|
| 724 |
+
],
|
| 725 |
+
"allowed_valid_storage_profiles": [
|
| 726 |
+
"pt/tensor_bundle/v1"
|
| 727 |
+
],
|
| 728 |
+
"valid_storage": "pt",
|
| 729 |
+
"tensor_container": "dict",
|
| 730 |
+
"valid_dtype": "bool"
|
| 731 |
+
},
|
| 732 |
+
"object/dimensions/v1": {
|
| 733 |
+
"storage": "pt",
|
| 734 |
+
"dtype": "float32",
|
| 735 |
+
"shape": [
|
| 736 |
+
"T",
|
| 737 |
+
3
|
| 738 |
+
],
|
| 739 |
+
"valid_shape": [
|
| 740 |
+
"T"
|
| 741 |
+
],
|
| 742 |
+
"unit": "m",
|
| 743 |
+
"required_metadata": [
|
| 744 |
+
"dimensions_semantics",
|
| 745 |
+
"data_ref",
|
| 746 |
+
"data_key",
|
| 747 |
+
"valid_ref",
|
| 748 |
+
"valid_key",
|
| 749 |
+
"storage",
|
| 750 |
+
"valid_storage"
|
| 751 |
+
],
|
| 752 |
+
"axis_order": [
|
| 753 |
+
"length",
|
| 754 |
+
"width",
|
| 755 |
+
"height"
|
| 756 |
+
],
|
| 757 |
+
"scale_rule": "do not apply to mesh without source-supported size/scale relation",
|
| 758 |
+
"allowed_storage_profiles": [
|
| 759 |
+
"pt/tensor_bundle/v1"
|
| 760 |
+
],
|
| 761 |
+
"allowed_valid_storage_profiles": [
|
| 762 |
+
"pt/tensor_bundle/v1"
|
| 763 |
+
],
|
| 764 |
+
"valid_storage": "pt",
|
| 765 |
+
"tensor_container": "dict",
|
| 766 |
+
"valid_dtype": "bool"
|
| 767 |
+
},
|
| 768 |
+
"object_keypoints/template/v1": {
|
| 769 |
+
"storage": "pt",
|
| 770 |
+
"dtype": "float32",
|
| 771 |
+
"shape": [
|
| 772 |
+
"K",
|
| 773 |
+
3
|
| 774 |
+
],
|
| 775 |
+
"valid_shape": [
|
| 776 |
+
"K"
|
| 777 |
+
],
|
| 778 |
+
"unit": "m",
|
| 779 |
+
"coordinate_frame": "object",
|
| 780 |
+
"static": true,
|
| 781 |
+
"required_metadata": [
|
| 782 |
+
"keypoint_schema",
|
| 783 |
+
"data_ref",
|
| 784 |
+
"data_key",
|
| 785 |
+
"valid_ref",
|
| 786 |
+
"valid_key",
|
| 787 |
+
"storage",
|
| 788 |
+
"valid_storage"
|
| 789 |
+
],
|
| 790 |
+
"allowed_storage_profiles": [
|
| 791 |
+
"pt/tensor_bundle/v1"
|
| 792 |
+
],
|
| 793 |
+
"allowed_valid_storage_profiles": [
|
| 794 |
+
"pt/tensor_bundle/v1"
|
| 795 |
+
],
|
| 796 |
+
"valid_storage": "pt",
|
| 797 |
+
"tensor_container": "dict",
|
| 798 |
+
"valid_dtype": "bool"
|
| 799 |
+
},
|
| 800 |
+
"mesh/obj/v1": {
|
| 801 |
+
"storage": "obj",
|
| 802 |
+
"unit": "m",
|
| 803 |
+
"static": true,
|
| 804 |
+
"valid_shape": [],
|
| 805 |
+
"dependencies": "MTL and textures retained under owning object"
|
| 806 |
+
},
|
| 807 |
+
"rgb/uint8/v1": {
|
| 808 |
+
"storage": "mkv",
|
| 809 |
+
"dtype": "uint8",
|
| 810 |
+
"shape": [
|
| 811 |
+
"T",
|
| 812 |
+
"H",
|
| 813 |
+
"W",
|
| 814 |
+
3
|
| 815 |
+
],
|
| 816 |
+
"valid_shape": [
|
| 817 |
+
"T"
|
| 818 |
+
],
|
| 819 |
+
"color_order": "RGB",
|
| 820 |
+
"allowed_storage_profiles": [
|
| 821 |
+
"mkv/mjpeg_copy/v1",
|
| 822 |
+
"mkv/source_copy/v1",
|
| 823 |
+
"mkv/h264_rgb_lossless/v1",
|
| 824 |
+
"mkv/ffv1_rgb/v1"
|
| 825 |
+
],
|
| 826 |
+
"required_metadata": [
|
| 827 |
+
"storage"
|
| 828 |
+
]
|
| 829 |
+
},
|
| 830 |
+
"contact/relations/v1": {
|
| 831 |
+
"storage": "jsonl",
|
| 832 |
+
"valid_shape": [
|
| 833 |
+
"T"
|
| 834 |
+
],
|
| 835 |
+
"frame_keys": [
|
| 836 |
+
"frame_index",
|
| 837 |
+
"relations"
|
| 838 |
+
],
|
| 839 |
+
"absence_semantics": "no record is not a negative contact annotation"
|
| 840 |
+
},
|
| 841 |
+
"contact/vertex_region/v1": {
|
| 842 |
+
"storage": "pt",
|
| 843 |
+
"dtype": "bool",
|
| 844 |
+
"shape": [
|
| 845 |
+
"T",
|
| 846 |
+
"V"
|
| 847 |
+
],
|
| 848 |
+
"valid_shape": [
|
| 849 |
+
"T",
|
| 850 |
+
"V"
|
| 851 |
+
],
|
| 852 |
+
"required_metadata": [
|
| 853 |
+
"source_geometry_ref",
|
| 854 |
+
"target_geometry_ref",
|
| 855 |
+
"topology_id",
|
| 856 |
+
"data_ref",
|
| 857 |
+
"data_key",
|
| 858 |
+
"valid_ref",
|
| 859 |
+
"valid_key",
|
| 860 |
+
"storage",
|
| 861 |
+
"valid_storage"
|
| 862 |
+
],
|
| 863 |
+
"pilot_status": "defined_not_empirically_validated",
|
| 864 |
+
"allowed_storage_profiles": [
|
| 865 |
+
"pt/tensor_bundle/v1"
|
| 866 |
+
],
|
| 867 |
+
"allowed_valid_storage_profiles": [
|
| 868 |
+
"pt/tensor_bundle/v1"
|
| 869 |
+
],
|
| 870 |
+
"valid_storage": "pt",
|
| 871 |
+
"tensor_container": "dict",
|
| 872 |
+
"valid_dtype": "bool"
|
| 873 |
+
},
|
| 874 |
+
"contact/vertex_distance/v1": {
|
| 875 |
+
"storage": "pt",
|
| 876 |
+
"dtype": "float32",
|
| 877 |
+
"shape": [
|
| 878 |
+
"T",
|
| 879 |
+
"V"
|
| 880 |
+
],
|
| 881 |
+
"valid_shape": [
|
| 882 |
+
"T",
|
| 883 |
+
"V"
|
| 884 |
+
],
|
| 885 |
+
"unit": "m",
|
| 886 |
+
"required_metadata": [
|
| 887 |
+
"source_geometry_ref",
|
| 888 |
+
"target_geometry_ref",
|
| 889 |
+
"topology_id",
|
| 890 |
+
"distance_definition",
|
| 891 |
+
"data_ref",
|
| 892 |
+
"data_key",
|
| 893 |
+
"valid_ref",
|
| 894 |
+
"valid_key",
|
| 895 |
+
"storage",
|
| 896 |
+
"valid_storage"
|
| 897 |
+
],
|
| 898 |
+
"pilot_status": "defined_not_empirically_validated",
|
| 899 |
+
"allowed_storage_profiles": [
|
| 900 |
+
"pt/tensor_bundle/v1"
|
| 901 |
+
],
|
| 902 |
+
"allowed_valid_storage_profiles": [
|
| 903 |
+
"pt/tensor_bundle/v1"
|
| 904 |
+
],
|
| 905 |
+
"valid_storage": "pt",
|
| 906 |
+
"tensor_container": "dict",
|
| 907 |
+
"valid_dtype": "bool"
|
| 908 |
+
},
|
| 909 |
+
"object/articulated/v1": {
|
| 910 |
+
"storage": "json",
|
| 911 |
+
"required_keys": [
|
| 912 |
+
"parts",
|
| 913 |
+
"joints"
|
| 914 |
+
],
|
| 915 |
+
"part_keys": [
|
| 916 |
+
"part_id",
|
| 917 |
+
"parent_id",
|
| 918 |
+
"has_model",
|
| 919 |
+
"mesh_ref"
|
| 920 |
+
],
|
| 921 |
+
"hierarchy_semantics": "declare mechanical articulation or semantic containment; containment alone does not imply joints",
|
| 922 |
+
"acyclic": true
|
| 923 |
+
},
|
| 924 |
+
"segment/uint16_labels/v1": {
|
| 925 |
+
"storage": "mkv",
|
| 926 |
+
"dtype": "uint16",
|
| 927 |
+
"mapping": "instances.jsonl",
|
| 928 |
+
"valid_shape": [
|
| 929 |
+
"T"
|
| 930 |
+
],
|
| 931 |
+
"required_metadata": [
|
| 932 |
+
"segmentation_type",
|
| 933 |
+
"coverage",
|
| 934 |
+
"mapping_ref",
|
| 935 |
+
"storage"
|
| 936 |
+
],
|
| 937 |
+
"shape": [
|
| 938 |
+
"T",
|
| 939 |
+
"H",
|
| 940 |
+
"W"
|
| 941 |
+
],
|
| 942 |
+
"reserved_codes": {
|
| 943 |
+
"0": "unassigned",
|
| 944 |
+
"65535": "ignore"
|
| 945 |
+
},
|
| 946 |
+
"region_codes": [
|
| 947 |
+
1,
|
| 948 |
+
65534
|
| 949 |
+
],
|
| 950 |
+
"allowed_storage_profiles": [
|
| 951 |
+
"mkv/uint16_ffv1/v1"
|
| 952 |
+
]
|
| 953 |
+
},
|
| 954 |
+
"segment/instance_polygons/v1": {
|
| 955 |
+
"storage": "jsonl",
|
| 956 |
+
"mapping": "instances.jsonl",
|
| 957 |
+
"frame_keys": [
|
| 958 |
+
"frame_index",
|
| 959 |
+
"instances"
|
| 960 |
+
],
|
| 961 |
+
"instance_keys": [
|
| 962 |
+
"mask_value",
|
| 963 |
+
"polygons"
|
| 964 |
+
],
|
| 965 |
+
"coordinate_unit": "pixel",
|
| 966 |
+
"overlap_allowed": true,
|
| 967 |
+
"valid_shape": [
|
| 968 |
+
"T"
|
| 969 |
+
],
|
| 970 |
+
"required_metadata": [
|
| 971 |
+
"segmentation_type",
|
| 972 |
+
"coverage",
|
| 973 |
+
"mapping_ref"
|
| 974 |
+
],
|
| 975 |
+
"polygon_shape": [
|
| 976 |
+
"N",
|
| 977 |
+
2
|
| 978 |
+
],
|
| 979 |
+
"holes_supported": false
|
| 980 |
+
},
|
| 981 |
+
"segment/foreground_intensity/v1": {
|
| 982 |
+
"storage": "mkv",
|
| 983 |
+
"dtype": "uint16",
|
| 984 |
+
"value_range": [
|
| 985 |
+
0,
|
| 986 |
+
255
|
| 987 |
+
],
|
| 988 |
+
"normalization_scale": 0.00392156862745098,
|
| 989 |
+
"axes": [
|
| 990 |
+
"T",
|
| 991 |
+
"height",
|
| 992 |
+
"width"
|
| 993 |
+
],
|
| 994 |
+
"meaning": "native hand foreground intensity; individual hand or union declared in metadata; not instance codes or calibrated probability",
|
| 995 |
+
"zero": "background",
|
| 996 |
+
"full_scale": "foreground",
|
| 997 |
+
"mapping": "foreground_category in component metadata",
|
| 998 |
+
"valid_shape": [
|
| 999 |
+
"T"
|
| 1000 |
+
],
|
| 1001 |
+
"required_metadata": [
|
| 1002 |
+
"segmentation_type",
|
| 1003 |
+
"coverage",
|
| 1004 |
+
"value_range",
|
| 1005 |
+
"normalization_scale",
|
| 1006 |
+
"foreground_category",
|
| 1007 |
+
"entity_id",
|
| 1008 |
+
"storage"
|
| 1009 |
+
],
|
| 1010 |
+
"shape": [
|
| 1011 |
+
"T",
|
| 1012 |
+
"H",
|
| 1013 |
+
"W"
|
| 1014 |
+
],
|
| 1015 |
+
"allowed_storage_profiles": [
|
| 1016 |
+
"mkv/uint16_ffv1/v1"
|
| 1017 |
+
]
|
| 1018 |
+
},
|
| 1019 |
+
"object/vertex_part_ids/v1": {
|
| 1020 |
+
"storage": "pt",
|
| 1021 |
+
"tensor_container": "dict",
|
| 1022 |
+
"dtype": "int64",
|
| 1023 |
+
"shape": [
|
| 1024 |
+
"V"
|
| 1025 |
+
],
|
| 1026 |
+
"valid_shape": [
|
| 1027 |
+
"V"
|
| 1028 |
+
],
|
| 1029 |
+
"valid_dtype": "bool",
|
| 1030 |
+
"static": true,
|
| 1031 |
+
"unknown_value": -1,
|
| 1032 |
+
"valid_rule": "data != -1; every valid integer resolves in part_id_mapping",
|
| 1033 |
+
"required_metadata": [
|
| 1034 |
+
"mesh_ref",
|
| 1035 |
+
"topology_id",
|
| 1036 |
+
"part_id_mapping",
|
| 1037 |
+
"data_ref",
|
| 1038 |
+
"data_key",
|
| 1039 |
+
"valid_ref",
|
| 1040 |
+
"valid_key",
|
| 1041 |
+
"storage",
|
| 1042 |
+
"valid_storage"
|
| 1043 |
+
],
|
| 1044 |
+
"allowed_storage_profiles": [
|
| 1045 |
+
"pt/tensor_bundle/v1"
|
| 1046 |
+
],
|
| 1047 |
+
"allowed_valid_storage_profiles": [
|
| 1048 |
+
"pt/tensor_bundle/v1"
|
| 1049 |
+
],
|
| 1050 |
+
"valid_storage": "pt"
|
| 1051 |
+
}
|
| 1052 |
+
},
|
| 1053 |
+
"storage_revision": "lossless-video-2026-09-18",
|
| 1054 |
+
"sampling": {
|
| 1055 |
+
"image": {
|
| 1056 |
+
"single": {
|
| 1057 |
+
"T": 1
|
| 1058 |
+
},
|
| 1059 |
+
"independent": {
|
| 1060 |
+
"T": ">=2",
|
| 1061 |
+
"required_frame_fields": [
|
| 1062 |
+
"sample_id",
|
| 1063 |
+
"source_locator"
|
| 1064 |
+
],
|
| 1065 |
+
"temporal_relationship": false
|
| 1066 |
+
},
|
| 1067 |
+
"source_fps": null
|
| 1068 |
+
},
|
| 1069 |
+
"video": {
|
| 1070 |
+
"sampling_types": [
|
| 1071 |
+
"dense",
|
| 1072 |
+
"sparse"
|
| 1073 |
+
]
|
| 1074 |
+
}
|
| 1075 |
+
},
|
| 1076 |
+
"storage_profiles": {
|
| 1077 |
+
"mkv/mjpeg_copy/v1": {
|
| 1078 |
+
"container": "matroska",
|
| 1079 |
+
"codec": "mjpeg",
|
| 1080 |
+
"method": "stream_copy_from_source_jpeg",
|
| 1081 |
+
"logical_dtype": "uint8",
|
| 1082 |
+
"decoded_pixel_format": "rgb24",
|
| 1083 |
+
"validation": [
|
| 1084 |
+
"source_jpeg_packet_sha256_exact",
|
| 1085 |
+
"all_packet_count_order_and_dimensions_exact",
|
| 1086 |
+
"deterministic_decoded_rgb_sample_exact",
|
| 1087 |
+
"pilot_and_final_selected_whole_sequences_decoded_rgb_exact"
|
| 1088 |
+
],
|
| 1089 |
+
"validation_policy": {
|
| 1090 |
+
"id": "jpeg-packets-all-rgb-sample16/v1",
|
| 1091 |
+
"sample_count_per_view": 16,
|
| 1092 |
+
"short_views": "all_frames_if_T_less_than_16",
|
| 1093 |
+
"fixed_indices": "0,T-1,T//4,T//2,3*T//4, deduplicated",
|
| 1094 |
+
"remaining_indices": "sample without replacement to min(T,16) using Python random.Random(seed)",
|
| 1095 |
+
"seed": "first 8 bytes of SHA256(sequence_id/camera_id/20260920), big-endian integer",
|
| 1096 |
+
"report": "policy, exact selected frame indices, seed, separate packet and pixel coverage",
|
| 1097 |
+
"legacy_all_frame_pixel_proofs": "still accepted; preserve historical evidence"
|
| 1098 |
+
}
|
| 1099 |
+
},
|
| 1100 |
+
"mkv/source_copy/v1": {
|
| 1101 |
+
"container": "matroska",
|
| 1102 |
+
"codec": "source_codec_declared_in_metadata",
|
| 1103 |
+
"method": "stream_copy_only",
|
| 1104 |
+
"logical_dtype": "uint8",
|
| 1105 |
+
"decoded_pixel_format": "rgb24",
|
| 1106 |
+
"validation": [
|
| 1107 |
+
"no_reencoding",
|
| 1108 |
+
"all_decoded_rgb_frames_exact",
|
| 1109 |
+
"presentation_frame_order_exact"
|
| 1110 |
+
]
|
| 1111 |
+
},
|
| 1112 |
+
"mkv/h264_rgb_lossless/v1": {
|
| 1113 |
+
"container": "matroska",
|
| 1114 |
+
"codec": "h264",
|
| 1115 |
+
"encoder": "libx264rgb",
|
| 1116 |
+
"crf": 0,
|
| 1117 |
+
"decoded_pixel_format": "rgb24",
|
| 1118 |
+
"logical_dtype": "uint8",
|
| 1119 |
+
"gop": "declared_in_encoder_parameters",
|
| 1120 |
+
"validation": [
|
| 1121 |
+
"all_decoded_rgb_frames_exact"
|
| 1122 |
+
],
|
| 1123 |
+
"forbidden": [
|
| 1124 |
+
"lossy_rate_control",
|
| 1125 |
+
"rgb_to_yuv420_subsampling"
|
| 1126 |
+
]
|
| 1127 |
+
},
|
| 1128 |
+
"mkv/ffv1_rgb/v1": {
|
| 1129 |
+
"container": "matroska",
|
| 1130 |
+
"codec": "ffv1",
|
| 1131 |
+
"decoded_pixel_format": "rgb24",
|
| 1132 |
+
"logical_dtype": "uint8",
|
| 1133 |
+
"validation": [
|
| 1134 |
+
"all_decoded_rgb_frames_exact"
|
| 1135 |
+
]
|
| 1136 |
+
},
|
| 1137 |
+
"mkv/depth_float32_bits/v1": {
|
| 1138 |
+
"container": "matroska",
|
| 1139 |
+
"codec": "ffv1",
|
| 1140 |
+
"pixel_format": "gray16le",
|
| 1141 |
+
"logical_dtype": "float32",
|
| 1142 |
+
"logical_shape": [
|
| 1143 |
+
"T",
|
| 1144 |
+
"H",
|
| 1145 |
+
"W"
|
| 1146 |
+
],
|
| 1147 |
+
"encoded_shape": [
|
| 1148 |
+
"T",
|
| 1149 |
+
"H",
|
| 1150 |
+
"2*W"
|
| 1151 |
+
],
|
| 1152 |
+
"packing": "IEEE754 little-endian float32 bits; low uint16 in first W columns, high uint16 in last W columns",
|
| 1153 |
+
"decode": "reinterpret_float32(uint32(low) | (uint32(high) << 16))",
|
| 1154 |
+
"validation": [
|
| 1155 |
+
"all_float32_bits_exact_including_nan"
|
| 1156 |
+
]
|
| 1157 |
+
},
|
| 1158 |
+
"mkv/bool_ffv1/v1": {
|
| 1159 |
+
"container": "matroska",
|
| 1160 |
+
"codec": "ffv1",
|
| 1161 |
+
"pixel_format": "gray",
|
| 1162 |
+
"logical_dtype": "bool",
|
| 1163 |
+
"stored_values": [
|
| 1164 |
+
0,
|
| 1165 |
+
1
|
| 1166 |
+
],
|
| 1167 |
+
"validation": [
|
| 1168 |
+
"all_bool_values_exact"
|
| 1169 |
+
]
|
| 1170 |
+
},
|
| 1171 |
+
"mkv/uint16_ffv1/v1": {
|
| 1172 |
+
"container": "matroska",
|
| 1173 |
+
"codec": "ffv1",
|
| 1174 |
+
"pixel_formats": [
|
| 1175 |
+
"gray",
|
| 1176 |
+
"gray16le"
|
| 1177 |
+
],
|
| 1178 |
+
"logical_dtype": "uint16",
|
| 1179 |
+
"gray_condition": "all values <=255; decode by exact uint8-to-uint16 promotion",
|
| 1180 |
+
"validation": [
|
| 1181 |
+
"all_integer_values_exact"
|
| 1182 |
+
]
|
| 1183 |
+
},
|
| 1184 |
+
"pt/tensor_bundle/v1": {
|
| 1185 |
+
"container": "pytorch_pt",
|
| 1186 |
+
"root_type": "dict",
|
| 1187 |
+
"dictionary_key_type": "nonempty_string",
|
| 1188 |
+
"allowed_value_types": [
|
| 1189 |
+
"dict",
|
| 1190 |
+
"CPU torch.Tensor"
|
| 1191 |
+
],
|
| 1192 |
+
"tensor_entry": {
|
| 1193 |
+
"required_keys": [
|
| 1194 |
+
"data",
|
| 1195 |
+
"valid"
|
| 1196 |
+
],
|
| 1197 |
+
"additional_keys": false,
|
| 1198 |
+
"data_type": "CPU torch.Tensor",
|
| 1199 |
+
"valid_type": "CPU torch.Tensor",
|
| 1200 |
+
"valid_dtype": "bool"
|
| 1201 |
+
},
|
| 1202 |
+
"metadata_location": "metainfo.json; do not duplicate strings, paths or custom objects inside bundles",
|
| 1203 |
+
"missing_entry": "omit entire entry; never fabricate absent modalities",
|
| 1204 |
+
"load": {
|
| 1205 |
+
"map_location": "cpu",
|
| 1206 |
+
"weights_only": true
|
| 1207 |
+
},
|
| 1208 |
+
"valid_shape_rule": "Use the specific component or attribute valid_shape; do not infer broadcasting or share validity across independent fields.",
|
| 1209 |
+
"validation": [
|
| 1210 |
+
"registered layout and key resolution",
|
| 1211 |
+
"CPU tensors only",
|
| 1212 |
+
"schema dtype and shape",
|
| 1213 |
+
"independent bool validity",
|
| 1214 |
+
"frame alignment unchanged",
|
| 1215 |
+
"invalid floating positions NaN",
|
| 1216 |
+
"pure migration exact data bytes and validity equality"
|
| 1217 |
+
],
|
| 1218 |
+
"not_applicable_to": [
|
| 1219 |
+
"media payloads",
|
| 1220 |
+
"media standalone validity tensors",
|
| 1221 |
+
"JSONL standalone validity tensors"
|
| 1222 |
+
]
|
| 1223 |
+
}
|
| 1224 |
+
},
|
| 1225 |
+
"video_metadata": {
|
| 1226 |
+
"required": [
|
| 1227 |
+
"profile",
|
| 1228 |
+
"codec",
|
| 1229 |
+
"pixel_format",
|
| 1230 |
+
"encoded_size",
|
| 1231 |
+
"decoder",
|
| 1232 |
+
"encoder_parameters",
|
| 1233 |
+
"source_lossy"
|
| 1234 |
+
],
|
| 1235 |
+
"source_lossy_values": [
|
| 1236 |
+
true,
|
| 1237 |
+
false,
|
| 1238 |
+
"unknown"
|
| 1239 |
+
],
|
| 1240 |
+
"timebase_role": "index_only",
|
| 1241 |
+
"lossless_reference": "source compressed packets or fixed-decoder source pixels; depth uses normalized standard float32 bits",
|
| 1242 |
+
"selection": "choose smaller complete candidate only after exact roundtrip validation"
|
| 1243 |
+
},
|
| 1244 |
+
"tensor_storage_revision": "tensor-bundle-2026-10-09",
|
| 1245 |
+
"release_layout": {
|
| 1246 |
+
"directory": "shared-v1.1",
|
| 1247 |
+
"release_id": "shared-v1.1",
|
| 1248 |
+
"migration": "Upgrade each dataset in place under shared-v1.0 during maintenance, validate completely, then rename to shared-v1.1; do not retain duplicate published trees. See MIGRATION.md."
|
| 1249 |
+
},
|
| 1250 |
+
"tensor_attributes": {
|
| 1251 |
+
"visibility": {
|
| 1252 |
+
"storage_profile": "pt/tensor_bundle/v1",
|
| 1253 |
+
"allowed_dtypes": [
|
| 1254 |
+
"bool",
|
| 1255 |
+
"float32"
|
| 1256 |
+
],
|
| 1257 |
+
"visibility_types": [
|
| 1258 |
+
"boolean",
|
| 1259 |
+
"ratio"
|
| 1260 |
+
],
|
| 1261 |
+
"ratio_range": [
|
| 1262 |
+
0,
|
| 1263 |
+
1
|
| 1264 |
+
],
|
| 1265 |
+
"scopes": {
|
| 1266 |
+
"whole_hand": {
|
| 1267 |
+
"shape": [
|
| 1268 |
+
"T",
|
| 1269 |
+
2
|
| 1270 |
+
],
|
| 1271 |
+
"valid_shape": [
|
| 1272 |
+
"T",
|
| 1273 |
+
2
|
| 1274 |
+
]
|
| 1275 |
+
},
|
| 1276 |
+
"hand_keypoint": {
|
| 1277 |
+
"shape": [
|
| 1278 |
+
"T",
|
| 1279 |
+
2,
|
| 1280 |
+
"K"
|
| 1281 |
+
],
|
| 1282 |
+
"valid_shape": [
|
| 1283 |
+
"T",
|
| 1284 |
+
2,
|
| 1285 |
+
"K"
|
| 1286 |
+
]
|
| 1287 |
+
},
|
| 1288 |
+
"object": {
|
| 1289 |
+
"shape": [
|
| 1290 |
+
"T"
|
| 1291 |
+
],
|
| 1292 |
+
"valid_shape": [
|
| 1293 |
+
"T"
|
| 1294 |
+
]
|
| 1295 |
+
}
|
| 1296 |
+
},
|
| 1297 |
+
"required_metadata": [
|
| 1298 |
+
"data_ref",
|
| 1299 |
+
"data_key",
|
| 1300 |
+
"axes",
|
| 1301 |
+
"dtype",
|
| 1302 |
+
"visibility_type",
|
| 1303 |
+
"meaning",
|
| 1304 |
+
"valid_ref",
|
| 1305 |
+
"valid_key",
|
| 1306 |
+
"valid_axes",
|
| 1307 |
+
"storage",
|
| 1308 |
+
"valid_storage",
|
| 1309 |
+
"provenance",
|
| 1310 |
+
"source_locator"
|
| 1311 |
+
],
|
| 1312 |
+
"valid_dtype": "bool",
|
| 1313 |
+
"unknown": "valid=false; ratio data NaN; boolean data is not interpretable without valid",
|
| 1314 |
+
"all_known": "explicit all-true bool tensor; do not infer from pose validity",
|
| 1315 |
+
"note": "No source visibility means omit. Expand explicitly declared all-known scalar validity during migration without changing semantics."
|
| 1316 |
+
}
|
| 1317 |
+
},
|
| 1318 |
+
"tensor_bundles": {
|
| 1319 |
+
"camera": {
|
| 1320 |
+
"path": "camera/camera.pt",
|
| 1321 |
+
"entries": {
|
| 1322 |
+
"intrinsic": {
|
| 1323 |
+
"schema_ids": [
|
| 1324 |
+
"camera/pinhole/v1",
|
| 1325 |
+
"camera/rational8/v1",
|
| 1326 |
+
"camera/opencv_fisheye4/v1",
|
| 1327 |
+
"camera/fisheye624/v1"
|
| 1328 |
+
]
|
| 1329 |
+
},
|
| 1330 |
+
"extrinsic": {
|
| 1331 |
+
"schema_ids": [
|
| 1332 |
+
"transform/se3/v1"
|
| 1333 |
+
]
|
| 1334 |
+
},
|
| 1335 |
+
"distortion": {
|
| 1336 |
+
"schema_ids": [
|
| 1337 |
+
"camera/distortion8/v1",
|
| 1338 |
+
"camera/fisheye4_distortion/v1"
|
| 1339 |
+
]
|
| 1340 |
+
}
|
| 1341 |
+
}
|
| 1342 |
+
},
|
| 1343 |
+
"mano": {
|
| 1344 |
+
"path": "annotation/mano/mano.pt",
|
| 1345 |
+
"entries": {
|
| 1346 |
+
"motion": {
|
| 1347 |
+
"schema_ids": [
|
| 1348 |
+
"mano/axis_angle61/v1"
|
| 1349 |
+
]
|
| 1350 |
+
},
|
| 1351 |
+
"visibility": {
|
| 1352 |
+
"attribute_id": "visibility",
|
| 1353 |
+
"scope": "whole_hand"
|
| 1354 |
+
}
|
| 1355 |
+
}
|
| 1356 |
+
},
|
| 1357 |
+
"keypoints": {
|
| 1358 |
+
"path": "annotation/keypoints/keypoints.pt",
|
| 1359 |
+
"entries": {
|
| 1360 |
+
"uv": {
|
| 1361 |
+
"schema_ids": [
|
| 1362 |
+
"keypoints/uv/v1"
|
| 1363 |
+
]
|
| 1364 |
+
},
|
| 1365 |
+
"xyz": {
|
| 1366 |
+
"schema_ids": [
|
| 1367 |
+
"keypoints/xyz/v1"
|
| 1368 |
+
]
|
| 1369 |
+
},
|
| 1370 |
+
"visibility": {
|
| 1371 |
+
"attribute_id": "visibility",
|
| 1372 |
+
"scope": "hand_keypoint"
|
| 1373 |
+
},
|
| 1374 |
+
"whole_hand_visibility": {
|
| 1375 |
+
"attribute_id": "visibility",
|
| 1376 |
+
"scope": "whole_hand"
|
| 1377 |
+
}
|
| 1378 |
+
}
|
| 1379 |
+
},
|
| 1380 |
+
"object": {
|
| 1381 |
+
"path": "annotation/object/<object_id>/object.pt",
|
| 1382 |
+
"entries": {
|
| 1383 |
+
"pose": {
|
| 1384 |
+
"schema_ids": [
|
| 1385 |
+
"object/rigid/v1"
|
| 1386 |
+
]
|
| 1387 |
+
},
|
| 1388 |
+
"visibility": {
|
| 1389 |
+
"attribute_id": "visibility",
|
| 1390 |
+
"scope": "object"
|
| 1391 |
+
},
|
| 1392 |
+
"dimensions": {
|
| 1393 |
+
"schema_ids": [
|
| 1394 |
+
"object/dimensions/v1"
|
| 1395 |
+
]
|
| 1396 |
+
},
|
| 1397 |
+
"joint_state": {
|
| 1398 |
+
"schema_ids": [
|
| 1399 |
+
"object/joint_state/v1"
|
| 1400 |
+
]
|
| 1401 |
+
},
|
| 1402 |
+
"keypoints/xyz": {
|
| 1403 |
+
"schema_ids": [
|
| 1404 |
+
"object_keypoints/camera/v1"
|
| 1405 |
+
]
|
| 1406 |
+
},
|
| 1407 |
+
"keypoints/template_xyz": {
|
| 1408 |
+
"schema_ids": [
|
| 1409 |
+
"object_keypoints/template/v1"
|
| 1410 |
+
]
|
| 1411 |
+
},
|
| 1412 |
+
"parts/<part_id>/pose": {
|
| 1413 |
+
"schema_ids": [
|
| 1414 |
+
"transform/se3/v1"
|
| 1415 |
+
],
|
| 1416 |
+
"convention": "T_camera_from_part"
|
| 1417 |
+
},
|
| 1418 |
+
"parts/<part_id>/dimensions": {
|
| 1419 |
+
"schema_ids": [
|
| 1420 |
+
"object/dimensions/v1"
|
| 1421 |
+
]
|
| 1422 |
+
},
|
| 1423 |
+
"parts/<part_id>/keypoints/xyz": {
|
| 1424 |
+
"schema_ids": [
|
| 1425 |
+
"object_keypoints/camera/v1"
|
| 1426 |
+
]
|
| 1427 |
+
},
|
| 1428 |
+
"parts/<part_id>/keypoints/template_xyz": {
|
| 1429 |
+
"schema_ids": [
|
| 1430 |
+
"object_keypoints/template/v1"
|
| 1431 |
+
],
|
| 1432 |
+
"coordinate_frame": "part"
|
| 1433 |
+
},
|
| 1434 |
+
"meshes/<mesh_id>/vertex_part_ids": {
|
| 1435 |
+
"schema_ids": [
|
| 1436 |
+
"object/vertex_part_ids/v1"
|
| 1437 |
+
]
|
| 1438 |
+
}
|
| 1439 |
+
}
|
| 1440 |
+
},
|
| 1441 |
+
"contact_pair": {
|
| 1442 |
+
"path": "annotation/contact/<subject_id>__<object_id>/contact.pt",
|
| 1443 |
+
"entries": {
|
| 1444 |
+
"vertex_region": {
|
| 1445 |
+
"schema_ids": [
|
| 1446 |
+
"contact/vertex_region/v1"
|
| 1447 |
+
]
|
| 1448 |
+
},
|
| 1449 |
+
"vertex_distance": {
|
| 1450 |
+
"schema_ids": [
|
| 1451 |
+
"contact/vertex_distance/v1"
|
| 1452 |
+
]
|
| 1453 |
+
}
|
| 1454 |
+
}
|
| 1455 |
+
}
|
| 1456 |
+
},
|
| 1457 |
+
"bundle_layout_rules": {
|
| 1458 |
+
"entry_path_syntax": "Slash-separated dictionary keys in this registry only; serialize references as string arrays. Angle-bracket placeholders resolve to registered IDs, not literal keys.",
|
| 1459 |
+
"entry_leaves": [
|
| 1460 |
+
"data",
|
| 1461 |
+
"valid"
|
| 1462 |
+
],
|
| 1463 |
+
"additional_entries": false,
|
| 1464 |
+
"all_entries_optional": true,
|
| 1465 |
+
"omit_empty_bundles": true,
|
| 1466 |
+
"identifiers": "object/part/mesh and contact entity IDs must resolve in metadata; reject empty, dot, dot-dot or slash-containing IDs",
|
| 1467 |
+
"per_view": true,
|
| 1468 |
+
"no_cross_object_or_camera_merge": true,
|
| 1469 |
+
"numeric_field_valid_ref_equals_data_ref": true,
|
| 1470 |
+
"attributes_must_be_registered": true
|
| 1471 |
+
},
|
| 1472 |
+
"reference_rules": {
|
| 1473 |
+
"file_paths": {
|
| 1474 |
+
"base": "current camera view root",
|
| 1475 |
+
"format": "relative POSIX",
|
| 1476 |
+
"reject": [
|
| 1477 |
+
"absolute paths",
|
| 1478 |
+
"parent traversal",
|
| 1479 |
+
"external URLs",
|
| 1480 |
+
"unresolved placeholders"
|
| 1481 |
+
]
|
| 1482 |
+
},
|
| 1483 |
+
"dictionary_keys": {
|
| 1484 |
+
"type": "array",
|
| 1485 |
+
"item_type": "nonempty_string",
|
| 1486 |
+
"min_items": 1,
|
| 1487 |
+
"traversal": "literal nested dictionary lookup; never eval; no automatic flattening",
|
| 1488 |
+
"data_terminal": "data",
|
| 1489 |
+
"valid_terminal": "valid",
|
| 1490 |
+
"target_type": "CPU torch.Tensor"
|
| 1491 |
+
},
|
| 1492 |
+
"bundle_component": {
|
| 1493 |
+
"required": [
|
| 1494 |
+
"data_ref",
|
| 1495 |
+
"data_key",
|
| 1496 |
+
"valid_ref",
|
| 1497 |
+
"valid_key",
|
| 1498 |
+
"storage",
|
| 1499 |
+
"valid_storage"
|
| 1500 |
+
],
|
| 1501 |
+
"same_file": true,
|
| 1502 |
+
"same_entry_prefix": true,
|
| 1503 |
+
"storage_profile": "pt/tensor_bundle/v1",
|
| 1504 |
+
"valid_storage_profile": "pt/tensor_bundle/v1"
|
| 1505 |
+
},
|
| 1506 |
+
"media_jsonl": {
|
| 1507 |
+
"forbidden": [
|
| 1508 |
+
"data_key",
|
| 1509 |
+
"valid_key"
|
| 1510 |
+
],
|
| 1511 |
+
"preserve_original_valid_ref": true,
|
| 1512 |
+
"standalone_valid_pt_root": "CPU bool torch.Tensor; not dict",
|
| 1513 |
+
"do_not_label_standalone_valid_as_bundle": true
|
| 1514 |
+
},
|
| 1515 |
+
"camera_distortion": {
|
| 1516 |
+
"models": {
|
| 1517 |
+
"rational8": "camera/distortion8/v1",
|
| 1518 |
+
"opencv_fisheye4": "camera/fisheye4_distortion/v1"
|
| 1519 |
+
},
|
| 1520 |
+
"required": [
|
| 1521 |
+
"distortion_ref",
|
| 1522 |
+
"distortion_key",
|
| 1523 |
+
"distortion_valid_ref",
|
| 1524 |
+
"distortion_valid_key"
|
| 1525 |
+
],
|
| 1526 |
+
"distortion_ref": "camera/camera.pt",
|
| 1527 |
+
"distortion_key": [
|
| 1528 |
+
"distortion",
|
| 1529 |
+
"data"
|
| 1530 |
+
],
|
| 1531 |
+
"distortion_valid_ref": "camera/camera.pt",
|
| 1532 |
+
"distortion_valid_key": [
|
| 1533 |
+
"distortion",
|
| 1534 |
+
"valid"
|
| 1535 |
+
],
|
| 1536 |
+
"valid_equals_intrinsic_valid": true,
|
| 1537 |
+
"models_without_separate_distortion": [
|
| 1538 |
+
"pinhole",
|
| 1539 |
+
"fisheye624"
|
| 1540 |
+
]
|
| 1541 |
+
},
|
| 1542 |
+
"reader_cache": "Cache bundle by resolved file path; loading different fields must not repeatedly deserialize the file."
|
| 1543 |
+
},
|
| 1544 |
+
"standalone_validity": {
|
| 1545 |
+
"rgb": {
|
| 1546 |
+
"data_ref": "observation/rgb.mkv",
|
| 1547 |
+
"valid_ref": "observation/rgb_valid.pt",
|
| 1548 |
+
"dtype": "bool",
|
| 1549 |
+
"shape": [
|
| 1550 |
+
"T"
|
| 1551 |
+
],
|
| 1552 |
+
"container": "pt",
|
| 1553 |
+
"root_type": "CPU Tensor"
|
| 1554 |
+
},
|
| 1555 |
+
"segment": {
|
| 1556 |
+
"data_refs": [
|
| 1557 |
+
"annotation/segment/mask.mkv",
|
| 1558 |
+
"annotation/segment/polygons.jsonl"
|
| 1559 |
+
],
|
| 1560 |
+
"valid_ref": "preserve source release reference; normally annotation/segment/mask_valid.pt",
|
| 1561 |
+
"dtype": "bool",
|
| 1562 |
+
"shape": [
|
| 1563 |
+
"T"
|
| 1564 |
+
],
|
| 1565 |
+
"container": "pt",
|
| 1566 |
+
"root_type": "CPU Tensor"
|
| 1567 |
+
},
|
| 1568 |
+
"relations": {
|
| 1569 |
+
"data_ref": "annotation/contact/relations.jsonl",
|
| 1570 |
+
"valid_ref": "annotation/contact/relations_valid.pt",
|
| 1571 |
+
"dtype": "bool",
|
| 1572 |
+
"shape": [
|
| 1573 |
+
"T"
|
| 1574 |
+
],
|
| 1575 |
+
"container": "pt",
|
| 1576 |
+
"root_type": "CPU Tensor"
|
| 1577 |
+
},
|
| 1578 |
+
"depth": {
|
| 1579 |
+
"data_ref": "observation/depth.mkv",
|
| 1580 |
+
"valid_ref": "observation/depth_valid.mkv",
|
| 1581 |
+
"dtype": "bool",
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Build one TACO shared-v1.1 camera view's numeric annotations and assets."""
|
| 2 |
+
from collections import defaultdict, OrderedDict
|
| 3 |
+
from functools import lru_cache
|
| 4 |
+
import io
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
import pickle
|
| 9 |
+
import re
|
| 10 |
+
import sys
|
| 11 |
+
import tempfile
|
| 12 |
+
import zipfile
|
| 13 |
+
|
| 14 |
+
import numpy as np
|
| 15 |
+
from scipy.spatial.transform import Rotation
|
| 16 |
+
import torch
|
| 17 |
+
|
| 18 |
+
REF = Path(__file__).resolve().parent / 'reference'
|
| 19 |
+
if not (REF / 'mano.py').is_file():
|
| 20 |
+
REF = Path.home() / '.ho3d-formats/reference'
|
| 21 |
+
sys.path.insert(0, str(REF))
|
| 22 |
+
from mano import HASHES, load_model
|
| 23 |
+
|
| 24 |
+
MODELS = Path('/data/yanghonglei/do-as-i-do/reconstruction/modules')
|
| 25 |
+
MANO = {
|
| 26 |
+
'left': MODELS/'HaWoR/_DATA/data_left/mano_left/MANO_LEFT.pkl',
|
| 27 |
+
'right': MODELS/'WiLoR/mano_data/MANO_RIGHT.pkl',
|
| 28 |
+
}
|
| 29 |
+
ORDER = (0,13,14,15,16,1,2,3,17,4,5,6,18,10,11,12,19,7,8,9,20)
|
| 30 |
+
CAMERA_AXES = ['T','row','column']
|
| 31 |
+
BUNDLE = {'profile':'pt/tensor_bundle/v1'}
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
@lru_cache(maxsize=16)
|
| 35 |
+
def safe_storage(payload):
|
| 36 |
+
# Reject tar serialization and disallow arbitrary pickle globals in inner payloads.
|
| 37 |
+
if not payload.startswith((b'PK\x03\x04', b'\x80\x02\x8a\x0a')):
|
| 38 |
+
raise pickle.UnpicklingError('Unexpected serialized tensor storage format')
|
| 39 |
+
return torch.load(io.BytesIO(payload), map_location='cpu', weights_only=True)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class PosePickle(pickle.Unpickler):
|
| 43 |
+
def find_class(self, module, name):
|
| 44 |
+
known = {
|
| 45 |
+
('torch.storage','_load_from_bytes'):safe_storage,
|
| 46 |
+
('torch._utils','_rebuild_tensor'):torch._utils._rebuild_tensor,
|
| 47 |
+
('torch._utils','_rebuild_tensor_v2'):torch._utils._rebuild_tensor_v2,
|
| 48 |
+
('torch._utils','_rebuild_parameter'):torch._utils._rebuild_parameter,
|
| 49 |
+
('collections','OrderedDict'):OrderedDict,
|
| 50 |
+
('numpy','ndarray'):np.ndarray,
|
| 51 |
+
('numpy','dtype'):np.dtype,
|
| 52 |
+
('numpy.core.multiarray','_reconstruct'):np.core.multiarray._reconstruct,
|
| 53 |
+
}
|
| 54 |
+
if (module,name) not in known:
|
| 55 |
+
raise pickle.UnpicklingError(f'Unexpected pose pickle global: {module}.{name}')
|
| 56 |
+
return known[module,name]
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
def numeric(value):
|
| 60 |
+
if isinstance(value,torch.Tensor):
|
| 61 |
+
return value.detach().cpu().numpy()
|
| 62 |
+
return np.asarray(value)
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def component(schema, ref, loc, method, axes, kind='format_conversion', **meta):
|
| 66 |
+
return {'available':True,'schema_id':schema,'data_ref':ref,'axes':axes,
|
| 67 |
+
'source_locator':loc,'provenance':{'kind':kind,'method':method},**meta}
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def field(bundle, schema, ref, key, vals, valid, loc, method, axes, vaxes, **meta):
|
| 71 |
+
arr=np.asarray(vals,dtype=np.float32).copy()
|
| 72 |
+
assert arr.shape[:valid.ndim] == valid.shape
|
| 73 |
+
arr[~valid]=np.nan
|
| 74 |
+
bundle[key]={'data':torch.from_numpy(arr),'valid':torch.from_numpy(valid.astype(bool,copy=True))}
|
| 75 |
+
return component(schema,ref,loc,method,axes,data_key=[key,'data'],
|
| 76 |
+
valid_ref=ref,valid_key=[key,'valid'],valid_axes=vaxes,
|
| 77 |
+
storage=BUNDLE,valid_storage=BUNDLE,**meta)
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def save(view, ref, data):
|
| 81 |
+
path=view/ref
|
| 82 |
+
path.parent.mkdir(parents=True,exist_ok=True)
|
| 83 |
+
torch.save(data,path)
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def source(name, *members):
|
| 87 |
+
index={'member':members[0]} if len(members)==1 else {'members':list(members)}
|
| 88 |
+
return {'file':f'raw/data/{name}.zip',**index}
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def aligned_rows(arr, count, shape, context):
|
| 92 |
+
if arr.shape != (len(arr),*shape):
|
| 93 |
+
raise ValueError(f'{context}: unexpected shape {arr.shape}')
|
| 94 |
+
result=np.full((count,*shape),np.nan,dtype=np.float64)
|
| 95 |
+
size=min(count,len(arr))
|
| 96 |
+
result[:size]=arr[:size]
|
| 97 |
+
return result
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def rigid_valid(rows):
|
| 101 |
+
r=rows[:,:3,:3]
|
| 102 |
+
with np.errstate(invalid='ignore',over='ignore'):
|
| 103 |
+
return np.isfinite(rows).all((1,2)) & (np.abs(np.linalg.det(r)-1)<.001) & (
|
| 104 |
+
np.max(np.abs(r.transpose(0,2,1)@r-np.eye(3)),axis=(1,2))<.001) & (
|
| 105 |
+
np.max(np.abs(rows[:,3]-[0,0,0,1]),axis=1)<1e-5)
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
def fk_joints(model, theta, betas, wrist, side):
|
| 109 |
+
"""Official flat-mean MANO kinematics and fingertip vertices, centered at the wrist."""
|
| 110 |
+
shaped=model['v_template']+np.einsum('nki,i->nk',model['shapedirs'],betas)
|
| 111 |
+
joints=model['J_regressor']@shaped
|
| 112 |
+
rot=Rotation.from_rotvec(theta.reshape(-1,3)).as_matrix().reshape(-1,16,3,3)
|
| 113 |
+
transform=np.zeros((len(theta),16,4,4))
|
| 114 |
+
transform[...,3,3]=1
|
| 115 |
+
transform[:,0,:3,:3]=rot[:,0]
|
| 116 |
+
transform[:,0,:3,3]=joints[0]
|
| 117 |
+
for j in range(1,16):
|
| 118 |
+
parent=model['kintree'][0,j]
|
| 119 |
+
local=np.broadcast_to(np.eye(4),(len(theta),4,4)).copy()
|
| 120 |
+
local[:,:3,:3]=rot[:,j]
|
| 121 |
+
local[:,:3,3]=joints[j]-joints[parent]
|
| 122 |
+
transform[:,j]=transform[:,parent]@local
|
| 123 |
+
rigid=transform.copy()
|
| 124 |
+
rigid[:,:,:3,3]-=np.einsum('tnij,nj->tni',rigid[:,:,:3,:3],joints)
|
| 125 |
+
tips=np.array([745,317,444 if side=='right' else 445,556,673])
|
| 126 |
+
posed=shaped[tips]+np.einsum('nki,ti->tnk',model['posedirs'][tips],
|
| 127 |
+
(rot[:,1:]-np.eye(3)).reshape(len(theta),-1))
|
| 128 |
+
blend=np.einsum('vn,tnij->tvij',model['weights'][tips],rigid)
|
| 129 |
+
skin=np.einsum('tvij,tvj->tvi',blend[:,:,:3,:3],posed)+blend[:,:,:3,3]
|
| 130 |
+
return np.concatenate((transform[:,:,:3,3],skin),axis=1)[:,ORDER]-joints[0]+wrist[:,None],joints[0]
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
class Sources:
|
| 134 |
+
def __init__(self, raw, cache, require_hands):
|
| 135 |
+
raw=Path(raw)
|
| 136 |
+
self.cache=Path(cache)
|
| 137 |
+
self.cache.mkdir(parents=True,exist_ok=True)
|
| 138 |
+
names=('Allocentric_Camera_Parameters','Egocentric_Camera_Parameters','Object_Models','Object_Poses')
|
| 139 |
+
self.zips={n:zipfile.ZipFile(raw/f'{n}.zip') for n in names}
|
| 140 |
+
hand=raw/'Hand_Poses.zip'
|
| 141 |
+
if require_hands or hand.exists():
|
| 142 |
+
self.zips['Hand_Poses']=zipfile.ZipFile(hand)
|
| 143 |
+
self.objects=defaultdict(list)
|
| 144 |
+
for member in self.zips['Object_Poses'].namelist():
|
| 145 |
+
parts=member.split('/')
|
| 146 |
+
if len(parts)==4 and parts[-1].endswith('.npy'):
|
| 147 |
+
self.objects[tuple(parts[1:3])].append(member)
|
| 148 |
+
self.meshes={Path(p).name.removesuffix('_cm.obj'):p for p in self.zips['Object_Models'].namelist()
|
| 149 |
+
if p.endswith('_cm.obj')}
|
| 150 |
+
self.models={side:load_model(path,side) for side,path in MANO.items()} if 'Hand_Poses' in self.zips else {}
|
| 151 |
+
load_hands = self._hands
|
| 152 |
+
if cache_root := os.environ.get('TACO_HANDS_CACHE_DIR'):
|
| 153 |
+
from taco_hands_cache import with_hands_cache
|
| 154 |
+
load_hands = with_hands_cache(self, load_hands, cache_root, Path.home()/'.taco-formats/source.json',
|
| 155 |
+
HASHES, Path(__file__), REF/'mano.py')
|
| 156 |
+
self.hands=lru_cache(maxsize=8)(load_hands)
|
| 157 |
+
self.calibration=lru_cache(maxsize=12)(self._calibration)
|
| 158 |
+
|
| 159 |
+
def npy(self, name, member):
|
| 160 |
+
return np.load(io.BytesIO(self.zips[name].read(member)),allow_pickle=False)
|
| 161 |
+
|
| 162 |
+
def _calibration(self, seq):
|
| 163 |
+
name='Allocentric_Camera_Parameters'
|
| 164 |
+
member='/'.join((name,*seq,'calibration.json'))
|
| 165 |
+
return member,json.loads(self.zips[name].read(member))
|
| 166 |
+
|
| 167 |
+
def _hands(self, seq):
|
| 168 |
+
name='Hand_Poses'
|
| 169 |
+
root='/'.join((name,*seq))
|
| 170 |
+
archive=self.zips[name]
|
| 171 |
+
result={}
|
| 172 |
+
for side,model in self.models.items():
|
| 173 |
+
pose=f'{root}/{side}_hand.pkl'
|
| 174 |
+
shape=f'{root}/{side}_hand_shape.pkl'
|
| 175 |
+
if pose not in archive.NameToInfo or shape not in archive.NameToInfo:
|
| 176 |
+
continue
|
| 177 |
+
records=PosePickle(io.BytesIO(archive.read(pose))).load()
|
| 178 |
+
beta=numeric(PosePickle(io.BytesIO(archive.read(shape))).load()['hand_shape']).reshape(10)
|
| 179 |
+
frames=sorted(records)
|
| 180 |
+
theta=np.stack([numeric(records[k]['hand_pose']).reshape(48) for k in frames])
|
| 181 |
+
wrist=np.stack([numeric(records[k]['hand_trans']).reshape(3) for k in frames])
|
| 182 |
+
valid=np.isfinite(theta).all(1)&np.isfinite(wrist).all(1)&np.isfinite(beta).all()
|
| 183 |
+
joints=np.full((len(frames),21,3),np.nan)
|
| 184 |
+
pivot=np.full(3,np.nan)
|
| 185 |
+
if valid.any():
|
| 186 |
+
joints[valid],pivot=fk_joints(model,theta[valid],beta,wrist[valid],side)
|
| 187 |
+
result[side]=(frames,theta,beta,wrist,pivot,joints,valid,pose,shape)
|
| 188 |
+
return result
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def open_index(raw, asset_cache, *, require_hands=True):
|
| 192 |
+
return Sources(raw,asset_cache,require_hands)
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
def camera_fields(seq, camera, count, size, view, src, rectified):
|
| 196 |
+
unknown={'model':'unknown','schema_id':None,'image_size':list(size)}
|
| 197 |
+
ego=camera in ('ego','egocentric')
|
| 198 |
+
if ego:
|
| 199 |
+
name='Egocentric_Camera_Parameters'
|
| 200 |
+
root='/'.join((name,*seq))
|
| 201 |
+
e=f'{root}/egocentric_frame_extrinsic.npy'
|
| 202 |
+
k=f'{root}/egocentric_intrinsic.txt'
|
| 203 |
+
if k not in src.zips[name].NameToInfo:
|
| 204 |
+
return {},unknown,None,None,None
|
| 205 |
+
intr=np.loadtxt(io.BytesIO(src.zips[name].read(k))).reshape(3,3)
|
| 206 |
+
ext=aligned_rows(src.npy(name,e),count,(4,4),e) if e in src.zips[name].NameToInfo else None
|
| 207 |
+
dist=None
|
| 208 |
+
original=(1920,1080)
|
| 209 |
+
else:
|
| 210 |
+
name='Allocentric_Camera_Parameters'
|
| 211 |
+
e,calibrations=src.calibration(seq)
|
| 212 |
+
k=e
|
| 213 |
+
rec=calibrations.get(str(camera))
|
| 214 |
+
if rec is None:
|
| 215 |
+
return {},unknown,None,None,None
|
| 216 |
+
intr=np.asarray(rec['K']).reshape(3,3)
|
| 217 |
+
matrix=np.eye(4)
|
| 218 |
+
matrix[:3,:3]=np.asarray(rec['R']).reshape(3,3)
|
| 219 |
+
matrix[:3,3]=rec['T']
|
| 220 |
+
ext=np.broadcast_to(matrix,(count,4,4))
|
| 221 |
+
original=tuple(rec['imgSize'])
|
| 222 |
+
dist=np.asarray(rec['distCoeff'],dtype=float).reshape(-1)
|
| 223 |
+
if rectified:
|
| 224 |
+
import cv2
|
| 225 |
+
intr,_=cv2.getOptimalNewCameraMatrix(intr,dist,original,float(rec['rectifyAlpha']),original)
|
| 226 |
+
dist=None
|
| 227 |
+
elif len(dist)==5:
|
| 228 |
+
dist=np.r_[dist,[0.,0.,0.]]
|
| 229 |
+
elif len(dist)!=8:
|
| 230 |
+
raise ValueError(f'Unrecognized distortion form at {seq}/{camera}: {dist.shape}')
|
| 231 |
+
intr=np.diag([size[0]/original[0],size[1]/original[1],1.])@intr
|
| 232 |
+
valid=np.full(count,np.isfinite(intr).all() and (intr.diagonal()>0).all())
|
| 233 |
+
if not valid.any():
|
| 234 |
+
return {},unknown,None,None,None
|
| 235 |
+
valid_e=rigid_valid(ext) if ext is not None else None
|
| 236 |
+
profile='pinhole' if dist is None else 'rational8'
|
| 237 |
+
schema=f'camera/{profile}/v1'
|
| 238 |
+
ref='camera/camera.pt'
|
| 239 |
+
bundle={}
|
| 240 |
+
extra={}
|
| 241 |
+
if dist is not None:
|
| 242 |
+
arr=np.broadcast_to(dist,(count,8)).astype(np.float32,copy=True)
|
| 243 |
+
if not np.isfinite(arr).all():
|
| 244 |
+
raise ValueError(f'Invalid source distortion: {seq}/{camera}')
|
| 245 |
+
bundle['distortion']={'data':torch.from_numpy(arr),'valid':torch.from_numpy(valid)}
|
| 246 |
+
extra=dict(distortion_ref=ref,distortion_key=['distortion','data'],
|
| 247 |
+
distortion_valid_ref=ref,distortion_valid_key=['distortion','valid'],
|
| 248 |
+
distortion_storage=BUNDLE,distortion_valid_storage=BUNDLE,
|
| 249 |
+
distortion_parameter_order=['k1','k2','p1','p2','k3','k4','k5','k6'])
|
| 250 |
+
loc=source(name,k)
|
| 251 |
+
if not ego:
|
| 252 |
+
loc['camera_serial']=str(camera)
|
| 253 |
+
cam={'intrinsic':field(bundle,schema,ref,'intrinsic',np.broadcast_to(intr,(count,3,3)),valid,loc,
|
| 254 |
+
'Released K scaled separately along the two decoded RGB axes',
|
| 255 |
+
CAMERA_AXES,['T'],source_image_size=list(original),**extra)}
|
| 256 |
+
if ext is not None and valid_e.any():
|
| 257 |
+
cam['extrinsic']=field(bundle,'transform/se3/v1',ref,'extrinsic',ext,valid_e,source(name,e),
|
| 258 |
+
'Released OpenCV T_camera_from_world, translations in meters',
|
| 259 |
+
CAMERA_AXES,['T'],convention='T_camera_from_world',world_frame=f'TACO/{seq[1]}/mocap_world')
|
| 260 |
+
else:
|
| 261 |
+
ext=None
|
| 262 |
+
save(view,ref,bundle)
|
| 263 |
+
return cam,{'model':profile,'schema_id':schema,'image_size':list(size)},ext,valid_e,(intr,dist)
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
def add_hands(out,view,seq,count,src,ext,valid_e,optics):
|
| 267 |
+
pose=np.full((count,2,61),np.nan)
|
| 268 |
+
points=np.full((count,2,21,3),np.nan)
|
| 269 |
+
valid=np.zeros((count,2),bool)
|
| 270 |
+
members=[]
|
| 271 |
+
hands=src.hands(seq)
|
| 272 |
+
for index,side in enumerate(('left','right')):
|
| 273 |
+
if side not in hands:
|
| 274 |
+
continue
|
| 275 |
+
keys,theta,beta,wrist,pivot,xyz,good,pm,sm=hands[side]
|
| 276 |
+
if len(keys)==count:
|
| 277 |
+
positions=np.arange(count)
|
| 278 |
+
else:
|
| 279 |
+
matches=[re.search(r'(\d+)(?:\.pkl)?$',str(key)) for key in keys]
|
| 280 |
+
if not all(matches):
|
| 281 |
+
raise ValueError(f'Cannot align hand frame keys: {seq}/{side}')
|
| 282 |
+
raw=np.asarray([int(x.group(1)) for x in matches])
|
| 283 |
+
if raw[0] not in (0,1) or not np.all(np.diff(raw)==1):
|
| 284 |
+
raise ValueError(f'Hand frame keys cannot confirm positional alignment: {seq}/{side}')
|
| 285 |
+
positions=raw-raw[0]
|
| 286 |
+
keep=(positions<count)&good&valid_e[np.minimum(positions,count-1)]
|
| 287 |
+
where=positions[keep]
|
| 288 |
+
if not len(where):
|
| 289 |
+
continue
|
| 290 |
+
r=ext[where,:3,:3]
|
| 291 |
+
t=ext[where,:3,3]
|
| 292 |
+
camera_axis=Rotation.from_matrix(r@Rotation.from_rotvec(theta[keep,:3]).as_matrix()).as_rotvec()
|
| 293 |
+
camera_wrist=(r@wrist[keep,:,None]).squeeze(-1)+t
|
| 294 |
+
pose[where,index]=np.c_[camera_axis,theta[keep,3:],np.broadcast_to(beta,(len(where),10)),camera_wrist-pivot]
|
| 295 |
+
points[where,index]=xyz[keep]@r.transpose(0,2,1)+t[:,None,:]
|
| 296 |
+
valid[where,index]=True
|
| 297 |
+
members.extend((pm,sm))
|
| 298 |
+
if not valid.any():
|
| 299 |
+
return
|
| 300 |
+
loc=source('Hand_Poses',*members)
|
| 301 |
+
ref='annotation/mano/mano.pt'
|
| 302 |
+
bundle={}
|
| 303 |
+
out['mano']=field(bundle,'mano/axis_angle61/v1',ref,'motion',pose,valid,loc,
|
| 304 |
+
'Official flat-mean MANO; map root axis and wrist meters to camera frame, then remove the shaped model root offset',
|
| 305 |
+
['T','hand','parameter'],['T','hand'],angle_unit='rad',unit='m',coordinate_frame='camera',
|
| 306 |
+
model_profile={'version':'TACO official manopth-compatible MANO 1.2','flat_hand_mean':True,
|
| 307 |
+
'left_shapedirs_correction':'not_applied','model_sha256':HASHES})
|
| 308 |
+
save(view,ref,bundle)
|
| 309 |
+
ref='annotation/keypoints/keypoints.pt'
|
| 310 |
+
bundle={}
|
| 311 |
+
xyz_valid=valid[:,:,None]&np.isfinite(points).all(-1)
|
| 312 |
+
out['keypoints_xyz']=field(bundle,'keypoints/xyz/v1',ref,'xyz',points,xyz_valid,loc,
|
| 313 |
+
'Forward kinematics from official flat-mean MANO and native camera extrinsics',
|
| 314 |
+
['T','hand','keypoint','xyz'],['T','hand','keypoint'],kind='derived',
|
| 315 |
+
unit='m',coordinate_frame='camera',keypoint_schema='mano21/v1')
|
| 316 |
+
uv=np.full((*points.shape[:-1],2),np.nan)
|
| 317 |
+
good=xyz_valid&(points[...,2]>1e-8)
|
| 318 |
+
if good.any():
|
| 319 |
+
import cv2
|
| 320 |
+
pixels,_=cv2.projectPoints(points[good],np.zeros(3),np.zeros(3),*optics)
|
| 321 |
+
uv[good]=pixels.reshape(-1,2)
|
| 322 |
+
good&=np.isfinite(uv).all(-1)
|
| 323 |
+
out['keypoints_uv']=field(bundle,'keypoints/uv/v1',ref,'uv',uv,good,loc,
|
| 324 |
+
'Project camera-frame MANO21 with the registered intrinsics and distortion',
|
| 325 |
+
['T','hand','keypoint','uv'],['T','hand','keypoint'],kind='derived',
|
| 326 |
+
unit='pixel',keypoint_schema='mano21/v1')
|
| 327 |
+
save(view,ref,bundle)
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
def metric_mesh(src, code, member):
|
| 331 |
+
path=src.cache/f'{code}_m.obj'
|
| 332 |
+
if path.is_file():
|
| 333 |
+
return path
|
| 334 |
+
data=src.zips['Object_Models'].read(member)
|
| 335 |
+
with tempfile.NamedTemporaryFile(dir=src.cache,mode='wb',delete=False) as draft:
|
| 336 |
+
for line in data.splitlines():
|
| 337 |
+
cols=line.split()
|
| 338 |
+
if cols and cols[0]==b'v':
|
| 339 |
+
xyz=[f'{float(c)*.01:.10g}'.encode('ascii') for c in cols[1:4]]
|
| 340 |
+
line=b' '.join((b'v',*xyz,*cols[4:]))
|
| 341 |
+
draft.write(line+b'\n')
|
| 342 |
+
try:
|
| 343 |
+
os.link(draft.name,path)
|
| 344 |
+
except FileExistsError:
|
| 345 |
+
# A sibling worker already sealed this identical metric mesh.
|
| 346 |
+
pass
|
| 347 |
+
finally:
|
| 348 |
+
Path(draft.name).unlink()
|
| 349 |
+
return path
|
| 350 |
+
|
| 351 |
+
|
| 352 |
+
def add_objects(out,view,seq,count,src,ext,valid_e):
|
| 353 |
+
labels=seq[0].strip('()').split(', ')
|
| 354 |
+
for member in sorted(src.objects.get(seq,[])):
|
| 355 |
+
name=Path(member).stem
|
| 356 |
+
role,code=name.split('_',1)
|
| 357 |
+
category=labels[1 if role=='tool' else 2] if len(labels)==3 else role
|
| 358 |
+
ref=f'annotation/object/{name}'
|
| 359 |
+
target=view/ref
|
| 360 |
+
target.mkdir(parents=True,exist_ok=True)
|
| 361 |
+
loc=source('Object_Poses',member)
|
| 362 |
+
info={'object_id':name,'identity_scope':'sequence','scope_id':seq[1],
|
| 363 |
+
'source_locator':loc,'category_id':category,'source_object_id':code,
|
| 364 |
+
'source_role':role,'has_model':False,'mesh_ref':None}
|
| 365 |
+
if ext is not None:
|
| 366 |
+
native=aligned_rows(src.npy('Object_Poses',member),count,(4,4),member)
|
| 367 |
+
good=rigid_valid(native)&valid_e
|
| 368 |
+
if good.any():
|
| 369 |
+
bundle={}
|
| 370 |
+
file=ref+'/object.pt'
|
| 371 |
+
out[f'pose_{name}']=field(bundle,'object/rigid/v1',file,'pose',ext@native,good,loc,
|
| 372 |
+
'Compose native T_world_from_object with released T_camera_from_world',
|
| 373 |
+
CAMERA_AXES,['T'],object_id=name,unit='m',convention='T_camera_from_object')
|
| 374 |
+
save(view,file,bundle)
|
| 375 |
+
if code in src.meshes:
|
| 376 |
+
model=src.meshes[code]
|
| 377 |
+
mesh=f'{ref}/assets/{code}_m.obj'
|
| 378 |
+
dest=view/mesh
|
| 379 |
+
dest.parent.mkdir(parents=True,exist_ok=True)
|
| 380 |
+
if not dest.exists():
|
| 381 |
+
os.link(metric_mesh(src,code,model),dest)
|
| 382 |
+
out[f'mesh_{name}']=component('mesh/obj/v1',mesh,source('Object_Models',model),
|
| 383 |
+
'Scale original object-frame OBJ vertex coordinates from centimeters to meters',
|
| 384 |
+
['vertex','xyz'],unit='m',object_id=name,valid=True)
|
| 385 |
+
info.update(has_model=True,mesh_ref=mesh)
|
| 386 |
+
(target/'metainfo.json').write_text(json.dumps(info,ensure_ascii=False,indent=2)+'\n')
|
| 387 |
+
|
| 388 |
+
|
| 389 |
+
def make_annotations(seq, camera, count, view_path, sources, *, size, rectified=False):
|
| 390 |
+
seq=tuple(seq)
|
| 391 |
+
view=Path(view_path)
|
| 392 |
+
out,info,ext,valid,optics=camera_fields(seq,camera,count,size,view,sources,rectified)
|
| 393 |
+
if ext is not None and sources.models:
|
| 394 |
+
add_hands(out,view,seq,count,sources,ext,valid,optics)
|
| 395 |
+
add_objects(out,view,seq,count,sources,ext,valid)
|
| 396 |
+
return out,info
|
TACO/shared-v1.1/script/taco_depth.py
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Pack exact TACO official ego depth into a shared-v1.1 FFV1 component."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
import subprocess
|
| 6 |
+
import numpy as np
|
| 7 |
+
|
| 8 |
+
FF=['ffmpeg','-nostdin','-loglevel','error','-threads','1','-filter_threads','1']
|
| 9 |
+
CODEC=['-c:v','ffv1','-level','3','-threads','1','-slices','4','-slicecrc','1']
|
| 10 |
+
VERSION=subprocess.check_output(['ffmpeg','-version'],text=True).splitlines()[0]
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class UnalignedDepth(ValueError):
|
| 14 |
+
def __init__(self, status, source_stream, rgb_size, rgb_frames):
|
| 15 |
+
self.proof={'status':status,'source_stream':source_stream,'rgb_size':list(rgb_size),'rgb_frames':rgb_frames}
|
| 16 |
+
super().__init__(str(self.proof))
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def probe(path):
|
| 20 |
+
data=subprocess.check_output(['ffprobe','-v','error','-select_streams','v:0','-show_entries',
|
| 21 |
+
'stream=width,height,codec_name,pix_fmt,avg_frame_rate,r_frame_rate,nb_frames','-of','json',str(path)])
|
| 22 |
+
return json.loads(data)['streams'][0]
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def writer(path,fmt,w,h):
|
| 26 |
+
return subprocess.Popen(FF+['-f','rawvideo','-pixel_format',fmt,'-video_size',f'{w}x{h}',
|
| 27 |
+
'-framerate','30','-i','pipe:0','-an']+CODEC+['-f','matroska',str(path)],stdin=subprocess.PIPE,bufsize=2**20)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def reader(path,fmt):
|
| 31 |
+
return subprocess.Popen(FF+['-i',str(path),'-map','0:v:0']+
|
| 32 |
+
['-vsync','0','-pix_fmt',fmt,'-f','rawvideo','-threads','1','pipe:1'],stdout=subprocess.PIPE,bufsize=2**20)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def stop(processes):
|
| 36 |
+
for p in processes:
|
| 37 |
+
if p.poll() is None:
|
| 38 |
+
p.kill()
|
| 39 |
+
p.wait()
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def assert_decode(path,fmt,n,frame_bytes,expected):
|
| 43 |
+
p=reader(path,fmt)
|
| 44 |
+
digest=hashlib.sha256()
|
| 45 |
+
try:
|
| 46 |
+
with p.stdout:
|
| 47 |
+
for i in range(n):
|
| 48 |
+
part=p.stdout.read(frame_bytes)
|
| 49 |
+
if len(part)!=frame_bytes:
|
| 50 |
+
raise ValueError(f'Stored depth is incomplete at frame {i}: {path}')
|
| 51 |
+
digest.update(part)
|
| 52 |
+
if p.stdout.read(1) or p.wait() or digest.hexdigest()!=expected:
|
| 53 |
+
raise ValueError(f'Stored depth bytes differ from conversion input: {path}')
|
| 54 |
+
finally:
|
| 55 |
+
stop([p])
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def build_depth(source:Path, view:Path, n:int, size:tuple[int,int], source_locator:dict):
|
| 59 |
+
stream=probe(source)
|
| 60 |
+
w,h=size
|
| 61 |
+
if (stream['width'],stream['height'])!=size or stream['pix_fmt'] not in ('gray16le','gray16be'):
|
| 62 |
+
raise UnalignedDepth('unregistered_grid_or_precision',stream,size,n)
|
| 63 |
+
t=stream.get('nb_frames','N/A')
|
| 64 |
+
if str(t).isdecimal() and int(t)!=n:
|
| 65 |
+
raise UnalignedDepth('source_depth_header_count_differs',stream,size,n)
|
| 66 |
+
data_ref,valid_ref='observation/depth.mkv','observation/depth_valid.mkv'
|
| 67 |
+
a,b=view/data_ref,view/valid_ref
|
| 68 |
+
a.parent.mkdir(exist_ok=True,parents=True)
|
| 69 |
+
inp=reader(source,'gray16le')
|
| 70 |
+
enc,enc_v=writer(a,'gray16le',2*w,h),writer(b,'gray',w,h)
|
| 71 |
+
digest,digest_v,src_hash=[hashlib.sha256() for _ in range(3)]
|
| 72 |
+
counts=0
|
| 73 |
+
try:
|
| 74 |
+
with inp.stdout:
|
| 75 |
+
for t in range(n):
|
| 76 |
+
raw=inp.stdout.read(2*w*h)
|
| 77 |
+
if len(raw)!=2*w*h:
|
| 78 |
+
if inp.wait() != 0:
|
| 79 |
+
raise ValueError(f'TACO source depth decoder failed at frame {t}: {source}')
|
| 80 |
+
raise UnalignedDepth('source_depth_decoded_count_differs',stream,size,n)
|
| 81 |
+
src_hash.update(raw)
|
| 82 |
+
integer=np.frombuffer(raw,'<u2').reshape(h,w)
|
| 83 |
+
valid=integer>0
|
| 84 |
+
counts+=int(valid.sum())
|
| 85 |
+
depth=integer.astype('<f4')
|
| 86 |
+
depth/=4000
|
| 87 |
+
depth[~valid]=np.nan
|
| 88 |
+
planes=depth.view('<u2').reshape(h,w,2)
|
| 89 |
+
canvas=np.empty((h,2*w),dtype='<u2')
|
| 90 |
+
canvas[:,:w]=planes[:,:,0]
|
| 91 |
+
canvas[:,w:]=planes[:,:,1]
|
| 92 |
+
packed=canvas.tobytes()
|
| 93 |
+
flags=valid.astype('u1').tobytes()
|
| 94 |
+
enc.stdin.write(packed)
|
| 95 |
+
enc_v.stdin.write(flags)
|
| 96 |
+
digest.update(packed)
|
| 97 |
+
digest_v.update(flags)
|
| 98 |
+
if inp.stdout.read(1):
|
| 99 |
+
raise UnalignedDepth('source_depth_decoded_count_differs',stream,size,n)
|
| 100 |
+
if inp.wait():
|
| 101 |
+
raise ValueError(f'TACO source depth decoder failed: {source}')
|
| 102 |
+
for p in (enc,enc_v):
|
| 103 |
+
p.stdin.close()
|
| 104 |
+
if p.wait():
|
| 105 |
+
raise ValueError(f'TACO depth FFV1 encoder stopped: {source}')
|
| 106 |
+
finally:
|
| 107 |
+
stop([inp,enc,enc_v])
|
| 108 |
+
assert_decode(a,'gray16le',n,4*w*h,digest.hexdigest())
|
| 109 |
+
assert_decode(b,'gray',n,w*h,digest_v.hexdigest())
|
| 110 |
+
def storage(profile,fmt,width):
|
| 111 |
+
return {'profile':profile,'codec':'ffv1','pixel_format':fmt,'encoded_size':[width,h],
|
| 112 |
+
'decoder':{'name':'ffmpeg','version':VERSION},'encoder_parameters':{'level':3},'source_lossy':False}
|
| 113 |
+
component={'available':True,'schema_id':'depth/z_float32/v1','data_ref':data_ref,'valid_ref':valid_ref,
|
| 114 |
+
'axes':['T','height','width'],'valid_axes':['T','height','width'],'unit':'m','depth_type':'z',
|
| 115 |
+
'depth_origin':'measured','invalid_value':'NaN','source_locator':source_locator,
|
| 116 |
+
'storage':storage('mkv/depth_float32_bits/v1','gray16le',2*w),
|
| 117 |
+
'valid_storage':storage('mkv/bool_ffv1/v1','gray',w),
|
| 118 |
+
'provenance':{'kind':'format_conversion','method':'Lossless decoded native uint16 frame paired by official source index, zero invalid, 4000 raw units per metre'}}
|
| 119 |
+
proof={'status':'verified','native_gray16le_sha256':src_hash.hexdigest(),'packed_sha256':digest.hexdigest(),
|
| 120 |
+
'valid_sha256':digest_v.hexdigest(),'valid_pixels':counts,'source_stream':stream,
|
| 121 |
+
'encoded_bytes':a.stat().st_size+b.stat().st_size}
|
| 122 |
+
return component,proof
|
TACO/shared-v1.1/script/taco_fast_depth.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Exact plane unpacking and per-process reuse of immutable shared TACO meshes."""
|
| 2 |
+
from collections import OrderedDict
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def unpack_depth(packed):
|
| 9 |
+
height,columns=packed.shape
|
| 10 |
+
width=columns//2
|
| 11 |
+
samples=np.empty((height,width,2),dtype='<u2')
|
| 12 |
+
samples[:,:,0]=packed[:,:width]
|
| 13 |
+
samples[:,:,1]=packed[:,width:]
|
| 14 |
+
return samples.view('<f4').reshape(height,width)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def install(reference):
|
| 18 |
+
original_obj=reference.load_obj
|
| 19 |
+
meshes=OrderedDict()
|
| 20 |
+
|
| 21 |
+
def load_obj(path):
|
| 22 |
+
stat=Path(path).stat()
|
| 23 |
+
key=(stat.st_dev,stat.st_ino,stat.st_size,stat.st_mtime_ns)
|
| 24 |
+
if key in meshes:
|
| 25 |
+
meshes.move_to_end(key)
|
| 26 |
+
else:
|
| 27 |
+
meshes[key]=original_obj(path)
|
| 28 |
+
if len(meshes)>24:
|
| 29 |
+
meshes.popitem(last=False)
|
| 30 |
+
return meshes[key]
|
| 31 |
+
|
| 32 |
+
reference.load_obj=load_obj
|
| 33 |
+
reference.unpack_depth=unpack_depth
|
TACO/shared-v1.1/script/taco_hands_cache.py
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Exact, optional cross-process cache for TACO world-space hand annotations."""
|
| 2 |
+
from fcntl import flock, LOCK_EX
|
| 3 |
+
import hashlib
|
| 4 |
+
import json
|
| 5 |
+
import os
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import shutil
|
| 8 |
+
import stat
|
| 9 |
+
import tempfile
|
| 10 |
+
from zipfile import BadZipFile
|
| 11 |
+
|
| 12 |
+
import numpy as np
|
| 13 |
+
|
| 14 |
+
SIDES = ('left', 'right')
|
| 15 |
+
COLUMNS = ('theta', 'beta', 'wrist', 'pivot', 'joints', 'valid')
|
| 16 |
+
ENTRY_LIMIT = 768 * 1024
|
| 17 |
+
MAX_SEQUENCES = 2317
|
| 18 |
+
MIN_FREE = 4 * 1024**3
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def _digest(items):
|
| 22 |
+
text = json.dumps(items, ensure_ascii=False, separators=(',', ':'), sort_keys=True)
|
| 23 |
+
return hashlib.sha256(text.encode('utf-8')).hexdigest()
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
def _identity(file):
|
| 27 |
+
info = os.fstat(file.fileno())
|
| 28 |
+
return (info.st_dev, info.st_ino, info.st_size, info.st_mtime_ns, info.st_ctime_ns)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def _read(path, seq, pin):
|
| 32 |
+
with np.load(path, allow_pickle=False) as stored:
|
| 33 |
+
meta = json.loads(stored['meta'].item())
|
| 34 |
+
if meta['pin'] != pin or tuple(meta['sequence']) != seq:
|
| 35 |
+
raise ValueError('Hand cache identity mismatch')
|
| 36 |
+
rows = {}
|
| 37 |
+
for side in SIDES:
|
| 38 |
+
if side not in meta['frames']:
|
| 39 |
+
continue
|
| 40 |
+
source = '/'.join(('Hand_Poses', *seq))
|
| 41 |
+
raw = tuple(stored[f'{side}_{name}'] for name in COLUMNS)
|
| 42 |
+
frames = meta['frames'][side]
|
| 43 |
+
expected = ((len(frames),48),(10,),(len(frames),3),(3,),(len(frames),21,3),(len(frames),))
|
| 44 |
+
if tuple(a.shape for a in raw) != expected or raw[-1].dtype != np.dtype(bool):
|
| 45 |
+
raise ValueError('Malformed cached hand tensor')
|
| 46 |
+
rows[side] = (frames, *raw, f'{source}/{side}_hand.pkl', f'{source}/{side}_hand_shape.pkl')
|
| 47 |
+
return rows
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def _save(path, seq, pin, rows):
|
| 51 |
+
frames = {}
|
| 52 |
+
arrays = {}
|
| 53 |
+
for side, row in rows.items():
|
| 54 |
+
frames[side] = row[0]
|
| 55 |
+
for name, data in zip(COLUMNS, row[1:7]):
|
| 56 |
+
if not isinstance(data, np.ndarray) or data.dtype.hasobject:
|
| 57 |
+
return
|
| 58 |
+
arrays[f'{side}_{name}'] = data
|
| 59 |
+
total = sum(data.nbytes for data in arrays.values())
|
| 60 |
+
if total > ENTRY_LIMIT or shutil.disk_usage(path.parent).free < MIN_FREE:
|
| 61 |
+
return
|
| 62 |
+
metadata = json.dumps({'pin':pin, 'sequence':seq, 'frames':frames}, ensure_ascii=False)
|
| 63 |
+
with tempfile.NamedTemporaryFile(dir=path.parent, prefix='.hand-', delete=False) as file:
|
| 64 |
+
temporary = Path(file.name)
|
| 65 |
+
try:
|
| 66 |
+
np.savez(file, meta=np.asarray(metadata), **arrays)
|
| 67 |
+
file.flush()
|
| 68 |
+
if file.tell() <= ENTRY_LIMIT:
|
| 69 |
+
temporary.replace(path)
|
| 70 |
+
finally:
|
| 71 |
+
if temporary.exists():
|
| 72 |
+
temporary.unlink()
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def with_hands_cache(source, load, root, manifest, model_hashes, converter, mano_source):
|
| 76 |
+
"""Bind to the pinned installed archive and the exact converter/runtime."""
|
| 77 |
+
archive = source.zips.get('Hand_Poses')
|
| 78 |
+
if archive is None or len(source.objects) > MAX_SEQUENCES:
|
| 79 |
+
return load
|
| 80 |
+
try:
|
| 81 |
+
manifest_data = json.loads(Path(manifest).read_text())
|
| 82 |
+
entry = next(row for row in manifest_data['siblings'] if row['rfilename'] == 'Hand_Poses.zip')
|
| 83 |
+
expected = entry['lfs']['sha256']
|
| 84 |
+
actual = _identity(archive.fp)
|
| 85 |
+
# The downloader SHA-verifies the pinned blob before exposing the non-.part path.
|
| 86 |
+
if actual[2] != entry['size'] or len(expected) != 64:
|
| 87 |
+
return load
|
| 88 |
+
pin = _digest([
|
| 89 |
+
manifest_data['sha'], expected, actual, model_hashes,
|
| 90 |
+
hashlib.sha256(Path(converter).read_bytes()).hexdigest(),
|
| 91 |
+
hashlib.sha256(Path(mano_source).read_bytes()).hexdigest(),
|
| 92 |
+
hashlib.sha256(Path(__file__).read_bytes()).hexdigest(),
|
| 93 |
+
np.__version__,
|
| 94 |
+
])
|
| 95 |
+
root = Path(root)
|
| 96 |
+
root.mkdir(mode=0o700, parents=True, exist_ok=True)
|
| 97 |
+
mode = root.lstat()
|
| 98 |
+
if mode.st_uid != os.getuid() or not stat.S_ISDIR(mode.st_mode) or stat.S_IMODE(mode.st_mode) != 0o700:
|
| 99 |
+
return load
|
| 100 |
+
directory = root / pin
|
| 101 |
+
directory.mkdir(mode=0o700, exist_ok=True)
|
| 102 |
+
except (OSError, BadZipFile, KeyError, ValueError, StopIteration):
|
| 103 |
+
return load
|
| 104 |
+
|
| 105 |
+
def cached(seq):
|
| 106 |
+
if seq not in source.objects:
|
| 107 |
+
return load(seq)
|
| 108 |
+
if actual != _identity(archive.fp):
|
| 109 |
+
raise ValueError('Pinned hand source changed while open')
|
| 110 |
+
key = _digest(seq)
|
| 111 |
+
path = directory / (key + '.npz')
|
| 112 |
+
try:
|
| 113 |
+
with (directory / (key + '.lock')).open('a+b') as guard:
|
| 114 |
+
flock(guard, LOCK_EX)
|
| 115 |
+
try:
|
| 116 |
+
return _read(path, seq, pin)
|
| 117 |
+
except (OSError, BadZipFile, EOFError, KeyError, ValueError):
|
| 118 |
+
rows = load(seq)
|
| 119 |
+
try:
|
| 120 |
+
_save(path, seq, pin, rows)
|
| 121 |
+
except OSError:
|
| 122 |
+
pass
|
| 123 |
+
return rows
|
| 124 |
+
except OSError as error:
|
| 125 |
+
if error.filename != str(directory / (key + '.lock')):
|
| 126 |
+
raise
|
| 127 |
+
return load(seq)
|
| 128 |
+
return cached
|
TACO/shared-v1.1/script/ta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|
|
|
|
|
|
|
| 1 |
+
"""Screen TACO source masks for zero-offset correspondence to released RGB."""
|
| 2 |
+
from collections import defaultdict
|
| 3 |
+
from contextlib import closing
|
| 4 |
+
import os
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
import select
|
| 7 |
+
import subprocess
|
| 8 |
+
import tempfile
|
| 9 |
+
|
| 10 |
+
import cv2
|
| 11 |
+
import numpy as np
|
| 12 |
+
|
| 13 |
+
OFFSETS = tuple(range(-8, 9))
|
| 14 |
+
TEMPORAL_BLOCKS = 3
|
| 15 |
+
ROWS_PER_BLOCK = 3
|
| 16 |
+
MIN_MOTION_BOUNDARY_PIXELS = 128
|
| 17 |
+
MAX_NATIVE_BOUNDARY_ERROR = 2.25
|
| 18 |
+
MIN_OFFSET_MARGIN_PIXELS = .10
|
| 19 |
+
MIN_OFFSET_MARGIN_FRACTION = .08
|
| 20 |
+
ROW_TOLERANCE_PIXELS = .06
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def moving_boundaries(masks, stride, rgb_frames):
|
| 24 |
+
rows = [[] for _ in range(TEMPORAL_BLOCKS)]
|
| 25 |
+
support = {}
|
| 26 |
+
kernel = np.ones((5, 5), dtype=np.uint8)
|
| 27 |
+
edge_kernel = np.ones((3, 3), dtype=np.uint8)
|
| 28 |
+
for index in range(1, len(masks)-1):
|
| 29 |
+
rgb = index*stride
|
| 30 |
+
if rgb+OFFSETS[0]<0 or rgb+OFFSETS[-1]>=rgb_frames:
|
| 31 |
+
continue
|
| 32 |
+
previous,current,following = masks[index-1:index+2]
|
| 33 |
+
edges = cv2.morphologyEx(current,cv2.MORPH_GRADIENT,edge_kernel)>0
|
| 34 |
+
changes = ((previous!=current)|(current!=following)).astype(np.uint8)
|
| 35 |
+
motion = cv2.dilate(changes,kernel)>0
|
| 36 |
+
count = np.count_nonzero(edges&motion)
|
| 37 |
+
if count<MIN_MOTION_BOUNDARY_PIXELS:
|
| 38 |
+
continue
|
| 39 |
+
block = min(TEMPORAL_BLOCKS-1,index*TEMPORAL_BLOCKS//len(masks))
|
| 40 |
+
rows[block].append((count,index))
|
| 41 |
+
selected = []
|
| 42 |
+
for block in rows:
|
| 43 |
+
picked = []
|
| 44 |
+
for _,index in sorted(block,key=lambda pair:(-pair[0],pair[1])):
|
| 45 |
+
if all(abs(index-i)>=2 for i in picked):
|
| 46 |
+
picked.append(index)
|
| 47 |
+
if len(picked)==ROWS_PER_BLOCK:
|
| 48 |
+
break
|
| 49 |
+
selected.append(sorted(picked))
|
| 50 |
+
for indices in selected:
|
| 51 |
+
for index in indices:
|
| 52 |
+
previous,current,following=masks[index-1:index+2]
|
| 53 |
+
edges=cv2.morphologyEx(current,cv2.MORPH_GRADIENT,edge_kernel)>0
|
| 54 |
+
changes=((previous!=current)|(current!=following)).astype(np.uint8)
|
| 55 |
+
motion=cv2.dilate(changes,kernel)>0
|
| 56 |
+
support[index]=np.where(edges&motion)
|
| 57 |
+
return selected,support
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def read_rgb_support(rgb_path,width,height,indices):
|
| 61 |
+
"""Yield the same selected grayscale frames in source presentation order."""
|
| 62 |
+
select_expr = '+'.join(f'eq(n\\,{i})' for i in indices)
|
| 63 |
+
command=[
|
| 64 |
+
'ffmpeg','-v','error','-nostdin','-noautorotate','-threads','1','-filter_threads','1',
|
| 65 |
+
'-i',str(rgb_path),'-map','0:v:0','-vf',f'select={select_expr},scale={width}:{height}:flags=area,format=gray',
|
| 66 |
+
'-frames:v',str(len(indices)),'-fps_mode','passthrough','-f','rawvideo','-threads','1','pipe:1',
|
| 67 |
+
]
|
| 68 |
+
frame_bytes=width*height
|
| 69 |
+
idle_timeout=180
|
| 70 |
+
with tempfile.TemporaryFile() as error_log, subprocess.Popen(
|
| 71 |
+
command,stdout=subprocess.PIPE,stderr=error_log,bufsize=0,
|
| 72 |
+
) as ffmpeg:
|
| 73 |
+
try:
|
| 74 |
+
for _ in indices:
|
| 75 |
+
frame=bytearray()
|
| 76 |
+
while len(frame)<frame_bytes:
|
| 77 |
+
if not select.select([ffmpeg.stdout],[],[],idle_timeout)[0]:
|
| 78 |
+
raise subprocess.TimeoutExpired(command,idle_timeout)
|
| 79 |
+
chunk=os.read(ffmpeg.stdout.fileno(),frame_bytes-len(frame))
|
| 80 |
+
if not chunk:
|
| 81 |
+
break
|
| 82 |
+
frame.extend(chunk)
|
| 83 |
+
if len(frame)!=frame_bytes:
|
| 84 |
+
raise ValueError(f'RGB offset audit output frame count differs for {rgb_path}')
|
| 85 |
+
yield np.frombuffer(frame,dtype=np.uint8).reshape(height,width)
|
| 86 |
+
rc=ffmpeg.wait(timeout=idle_timeout)
|
| 87 |
+
if rc:
|
| 88 |
+
error_log.seek(0)
|
| 89 |
+
raise subprocess.CalledProcessError(rc,command,stderr=error_log.read(4096))
|
| 90 |
+
finally:
|
| 91 |
+
if ffmpeg.poll() is None:
|
| 92 |
+
# A failed temporal third has already ruled out this view.
|
| 93 |
+
ffmpeg.kill()
|
| 94 |
+
ffmpeg.wait()
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def block_evidence(block, distances, support):
|
| 98 |
+
means={offset:float(np.mean([distances[index][offset] for index in block])) for offset in OFFSETS}
|
| 99 |
+
zero = means[0]
|
| 100 |
+
other,offset = min((mean,shift) for shift,mean in means.items() if shift)
|
| 101 |
+
margin = other-zero
|
| 102 |
+
agreeing = sum(row[0]<=min(row.values())+ROW_TOLERANCE_PIXELS
|
| 103 |
+
for index in block for row in (distances[index],))
|
| 104 |
+
accepted=(zero<=MAX_NATIVE_BOUNDARY_ERROR and
|
| 105 |
+
margin>=max(MIN_OFFSET_MARGIN_PIXELS,zero*MIN_OFFSET_MARGIN_FRACTION) and
|
| 106 |
+
agreeing*3>=len(block)*2)
|
| 107 |
+
return {
|
| 108 |
+
'mask_rows': block,
|
| 109 |
+
'moving_boundary_pixels': [int(len(support[index][0])) for index in block],
|
| 110 |
+
'zero_mean_error_px':round(zero,5),
|
| 111 |
+
'best_alternative_offset_frames':offset,
|
| 112 |
+
'best_alternative_mean_error_px':round(other,5),
|
| 113 |
+
'alternative_minus_zero_px':round(margin,5),
|
| 114 |
+
'zero_supported_rows':int(agreeing),
|
| 115 |
+
'passes_zero_offset_screen':bool(accepted),
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def assess_native_alignment(rgb_path: Path, masks: np.ndarray, rgb_frames: int, *, frame_stride: int=5) -> dict:
|
| 120 |
+
"""Certify dense RGB index k*stride only when native moving edges consistently favor it."""
|
| 121 |
+
if masks.ndim!=3 or masks.dtype!=np.dtype('uint8') or frame_stride<=0 or rgb_frames<1:
|
| 122 |
+
raise ValueError('Invalid source mask shape, dtype, cadence or RGB count')
|
| 123 |
+
expected = len(range(0,rgb_frames,frame_stride))
|
| 124 |
+
report = {'method':'sampled_native_motion_boundary_to_rgb_edge/v1',
|
| 125 |
+
'rgb_frames':rgb_frames,'source_mask_frames':len(masks),
|
| 126 |
+
'candidate_offsets_frames':list(OFFSETS),'assumed_rgb_stride_frames':frame_stride,
|
| 127 |
+
'status':'not_verified'}
|
| 128 |
+
if len(masks)!=expected:
|
| 129 |
+
return {**report,'reason':'source_count_mismatch'}
|
| 130 |
+
cv2.setNumThreads(1)
|
| 131 |
+
blocks,support = moving_boundaries(masks,frame_stride,rgb_frames)
|
| 132 |
+
report['sample_mask_rows_by_temporal_block'] = blocks
|
| 133 |
+
if any(len(block)<2 for block in blocks):
|
| 134 |
+
return {**report,'reason':'insufficient_motion_boundaries_across_clip'}
|
| 135 |
+
required = defaultdict(list)
|
| 136 |
+
for index in support:
|
| 137 |
+
for offset in OFFSETS:
|
| 138 |
+
required[index*frame_stride+offset].append((index,offset))
|
| 139 |
+
indices=sorted(required)
|
| 140 |
+
height,width=masks.shape[1:]
|
| 141 |
+
distances={index:{} for index in support}
|
| 142 |
+
# Every alternative for a block is available at its latest mask-row anchor + 8.
|
| 143 |
+
finish_at={block[-1]*frame_stride+OFFSETS[-1]:block for block in blocks}
|
| 144 |
+
results=[]
|
| 145 |
+
with closing(read_rgb_support(rgb_path,width,height,indices)) as images:
|
| 146 |
+
for i,picture in enumerate(images):
|
| 147 |
+
src_idx=indices[i]
|
| 148 |
+
edges = cv2.Canny(picture,36,108)
|
| 149 |
+
distance = cv2.distanceTransform((edges==0).astype(np.uint8),cv2.DIST_L2,3)
|
| 150 |
+
for index,offset in required[src_idx]:
|
| 151 |
+
y,x = support[index]
|
| 152 |
+
distances[index][offset] = float(np.minimum(distance[y,x],10.).mean())
|
| 153 |
+
if src_idx in finish_at:
|
| 154 |
+
result=block_evidence(finish_at[src_idx],distances,support)
|
| 155 |
+
results.append(result)
|
| 156 |
+
if not result['passes_zero_offset_screen'] and len(results)<len(blocks):
|
| 157 |
+
return {**report,'temporal_block_evidence':results,
|
| 158 |
+
'reason':'zero_offset_not_distinct_and_consistent',
|
| 159 |
+
'unassessed_temporal_blocks':list(range(len(results)+1,len(blocks)+1)),
|
| 160 |
+
'last_examined_rgb_frame_index':src_idx}
|
| 161 |
+
if len(results)!=len(blocks):
|
| 162 |
+
raise ValueError(f'Incomplete RGB temporal block evidence for {rgb_path}')
|
| 163 |
+
report['temporal_block_evidence']=results
|
| 164 |
+
if all(result['passes_zero_offset_screen'] for result in results):
|
| 165 |
+
return {**report,'status':'verified','verified_rgb_offset_frames':0}
|
| 166 |
+
return {**report,'reason':'zero_offset_not_distinct_and_consistent'}
|
TACO/shared-v1.1/script/taco_masks.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Convert TACO's released allocentric integer mask arrays without remapping IDs."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import io
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
import sys
|
| 6 |
+
|
| 7 |
+
from taco_sparse_ffv1 import build_sparse, SparsePacketUnsupported
|
| 8 |
+
|
| 9 |
+
import numpy as np
|
| 10 |
+
from PIL import Image
|
| 11 |
+
import torch
|
| 12 |
+
|
| 13 |
+
HELPERS = Path.home()/'.ho3d-formats'
|
| 14 |
+
if str(HELPERS) not in sys.path:
|
| 15 |
+
sys.path.insert(0,str(HELPERS))
|
| 16 |
+
from shared import component, complete, decoded, inspect, lines, src, start_writer, video_profile
|
| 17 |
+
|
| 18 |
+
ARCHIVE = '2D_Segmentation.zip'
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def native_member(triplet, sequence, camera):
|
| 22 |
+
return f'2D_Segmentation/{triplet}/{sequence}/{camera}_masks.npy'
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def build_native(archive, member, view, n, width, height, *, frame_stride=5, object_entities=None):
|
| 26 |
+
"""Return shared component and proof. Shape mismatches preserve the raw source."""
|
| 27 |
+
if archive is None or member is None or member not in archive.NameToInfo:
|
| 28 |
+
return None, {'status':'not_provided'}
|
| 29 |
+
data = np.load(io.BytesIO(archive.read(member)),allow_pickle=False)
|
| 30 |
+
return _build_native_array(data,member,view,n,width,height,
|
| 31 |
+
frame_stride=frame_stride,object_entities=object_entities)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def _build_native_array(data, member, view, n, width, height, *, frame_stride=5, object_entities=None):
|
| 35 |
+
"""Encode the CRC-checked NumPy array already loaded for the alignment audit."""
|
| 36 |
+
if frame_stride not in (1,5):
|
| 37 |
+
raise ValueError(f'Unverified TACO mask stride {frame_stride}')
|
| 38 |
+
source_ids = range(0,n,frame_stride)
|
| 39 |
+
summary = {'member':member,'source_shape':list(data.shape),'source_dtype':str(data.dtype)}
|
| 40 |
+
if data.ndim!=3 or data.shape[0]!=len(source_ids) or data.dtype != np.dtype('uint8'):
|
| 41 |
+
return None, {**summary,'status':'source_shape_or_type_mismatch','rgb_frames':n,'expected_mask_frames':len(source_ids)}
|
| 42 |
+
src_h,src_w = data.shape[1:]
|
| 43 |
+
if not any((src_w*scale,src_h*scale)==(width,height) for scale in (1,2,4)):
|
| 44 |
+
return None, {**summary,'status':'unregistered_spatial_grid','rgb_size':[width,height]}
|
| 45 |
+
if data.max(initial=0)>4:
|
| 46 |
+
return None, {**summary,'status':'unregistered_source_labels','max_source_label':int(data.max())}
|
| 47 |
+
identities = {}
|
| 48 |
+
if object_entities is None:
|
| 49 |
+
groups={}
|
| 50 |
+
for role in ('tool','target'):
|
| 51 |
+
candidates=[path.name for path in (view/'annotation/object').glob(role+'_*')
|
| 52 |
+
if path.is_dir() and path.name.removeprefix(role+'_').isdigit()]
|
| 53 |
+
if len(candidates)==1:
|
| 54 |
+
groups[role]=candidates[0]
|
| 55 |
+
if len(groups)==2:
|
| 56 |
+
object_entities=groups
|
| 57 |
+
if object_entities is not None:
|
| 58 |
+
if set(object_entities)!={'tool','target'}:
|
| 59 |
+
raise ValueError('Both official object roles must have registered entity IDs')
|
| 60 |
+
identities = {1:'hand_right',2:'hand_left',3:object_entities['tool'],4:object_entities['target']}
|
| 61 |
+
for role in ('tool','target'):
|
| 62 |
+
entity=object_entities[role]
|
| 63 |
+
if not entity.startswith(role+'_') or not entity.removeprefix(role+'_').isdigit():
|
| 64 |
+
raise ValueError(f'Unexpected registered {role} entity {entity}')
|
| 65 |
+
labels = set()
|
| 66 |
+
valid = torch.zeros(n,dtype=torch.bool)
|
| 67 |
+
valid[list(source_ids)] = True
|
| 68 |
+
ann = view/'annotation/segment'
|
| 69 |
+
ann.mkdir(parents=True,exist_ok=True)
|
| 70 |
+
path = ann/'mask.mkv'
|
| 71 |
+
mapping = [{'frame_index':index,'labels':[]} for index in range(n)]
|
| 72 |
+
|
| 73 |
+
def mask_at(index):
|
| 74 |
+
frame = data[index//frame_stride]
|
| 75 |
+
codes = np.flatnonzero(np.bincount(frame.ravel(),minlength=5))
|
| 76 |
+
row = []
|
| 77 |
+
for value in codes:
|
| 78 |
+
code=int(value)
|
| 79 |
+
if not code:
|
| 80 |
+
continue
|
| 81 |
+
labels.add(code)
|
| 82 |
+
entity=identities.get(code)
|
| 83 |
+
category=('hand' if code in (1,2) else int(entity.rsplit('_',1)[-1])) if entity else None
|
| 84 |
+
row.append({'mask_value':code,'source_instance_id':code,
|
| 85 |
+
'entity_id':entity,'part_id':None,'category_id':category})
|
| 86 |
+
mapping[index]['labels']=row
|
| 87 |
+
if (src_w,src_h)==(width,height):
|
| 88 |
+
return frame.tobytes()
|
| 89 |
+
return Image.fromarray(frame).resize((width,height),Image.Resampling.NEAREST).tobytes()
|
| 90 |
+
|
| 91 |
+
evidence = {}
|
| 92 |
+
encoding = {'mode':'lossless'}
|
| 93 |
+
fallback = None
|
| 94 |
+
if frame_stride==5 and len(source_ids)<n and width%2==0 and height%2==0:
|
| 95 |
+
try:
|
| 96 |
+
evidence = {'verification':'independent_decoded_pixels_and_complete_packet_sha256',
|
| 97 |
+
**build_sparse(path,width,height,'gray',30,n,source_ids,mask_at)}
|
| 98 |
+
encoding.update(level=3,gop=1,slicecrc=1,sparse_blank_packet_reused=True)
|
| 99 |
+
except SparsePacketUnsupported as error:
|
| 100 |
+
fallback = str(error)
|
| 101 |
+
if not evidence:
|
| 102 |
+
blank = bytes(width*height)
|
| 103 |
+
stream = start_writer(path,(width,height),'gray',['-c:v','ffv1','-threads','1','-pix_fmt','gray'])
|
| 104 |
+
checksum = hashlib.sha256()
|
| 105 |
+
try:
|
| 106 |
+
for index in range(n):
|
| 107 |
+
pixels = mask_at(index) if index in source_ids else blank
|
| 108 |
+
stream.stdin.write(pixels)
|
| 109 |
+
checksum.update(pixels)
|
| 110 |
+
complete(stream)
|
| 111 |
+
finally:
|
| 112 |
+
if not stream.stdin.closed:
|
| 113 |
+
stream.stdin.close()
|
| 114 |
+
if stream.proc.poll() is None:
|
| 115 |
+
stream.kill()
|
| 116 |
+
stream.wait()
|
| 117 |
+
decoded_hash = decoded(path,'gray',width*height,n)
|
| 118 |
+
if decoded_hash!=checksum.hexdigest():
|
| 119 |
+
raise RuntimeError(f'Native mask decode differs from source values for {member}')
|
| 120 |
+
evidence = {'verification':'complete_decoded_pixels','decoded_gray8_sha256':decoded_hash}
|
| 121 |
+
if fallback:
|
| 122 |
+
evidence['sparse_fallback_reason']=fallback
|
| 123 |
+
lines(ann/'instances.jsonl',mapping)
|
| 124 |
+
torch.save(valid,ann/'mask_valid.pt')
|
| 125 |
+
return component(
|
| 126 |
+
'segment/uint16_labels/v1','annotation/segment/mask.mkv',src(ARCHIVE,member),
|
| 127 |
+
'Official automatic 2D labels in original index order. Integer code values preserved. '
|
| 128 |
+
'Nearest-neighbor replication to RGB grid for integral downsampling. '
|
| 129 |
+
'An unavailable frame has zero stored labels and its validity is false. '
|
| 130 |
+
+ ('Source integer labels were verified against the registered hand and object geometry.' if identities
|
| 131 |
+
else 'Source label identities are unresolved.'),
|
| 132 |
+
['T','height','width'], segmentation_type='instance' if identities else 'semantic',mapping_ref='annotation/segment/instances.jsonl',
|
| 133 |
+
valid_ref='annotation/segment/mask_valid.pt',valid_axes=['T'],valid_storage={'profile':'pt/bool_tensor/v1'},
|
| 134 |
+
coverage={'kind':'unknown'},reserved_values={'0':'unassigned','65535':'ignore'},
|
| 135 |
+
storage=video_profile('mkv/uint16_ffv1/v1',inspect(path),(width,height),encoding,False),
|
| 136 |
+
source_mask_size=[src_w,src_h], source_label_codes=sorted(labels),
|
| 137 |
+
source_alignment={'method':'exact_index' if frame_stride==1 else 'rgb_moving_boundary_alignment',
|
| 138 |
+
'first_rgb_frame_index':0,'rgb_frame_stride':frame_stride}
|
| 139 |
+
), {**summary,'status':'verified','frames':n,'annotated_frames':len(source_ids),
|
| 140 |
+
'frame_stride':frame_stride,'source_labels':sorted(labels), **evidence}
|
TACO/shared-v1.1/script/taco_media_scratch.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Use bounded private tmpfs for source media materialization when requested."""
|
| 2 |
+
from contextlib import contextmanager
|
| 3 |
+
import os
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
import shutil
|
| 6 |
+
import stat
|
| 7 |
+
import tempfile
|
| 8 |
+
|
| 9 |
+
MAX_MEDIA_MEMBER_BYTES = 192 * 1024**2
|
| 10 |
+
MIN_FREE = 8 * 1024**3
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
@contextmanager
|
| 14 |
+
def source_media_workspace():
|
| 15 |
+
root = os.environ.get('TACO_SOURCE_MEDIA_RAM')
|
| 16 |
+
if not root:
|
| 17 |
+
yield None
|
| 18 |
+
return
|
| 19 |
+
folder = Path(root)
|
| 20 |
+
workspace = None
|
| 21 |
+
try:
|
| 22 |
+
folder.mkdir(mode=0o700, parents=True, exist_ok=True)
|
| 23 |
+
info = folder.lstat()
|
| 24 |
+
private = stat.S_ISDIR(info.st_mode) and info.st_uid == os.getuid() and stat.S_IMODE(info.st_mode) == 0o700
|
| 25 |
+
if private and shutil.disk_usage(folder).free >= MIN_FREE:
|
| 26 |
+
workspace = tempfile.TemporaryDirectory(dir=folder, prefix='taco-media-')
|
| 27 |
+
except OSError:
|
| 28 |
+
pass
|
| 29 |
+
if workspace is None:
|
| 30 |
+
yield None
|
| 31 |
+
return
|
| 32 |
+
with workspace as name:
|
| 33 |
+
yield Path(name)
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def pick_media_path(info, filename, draft, temporary):
|
| 37 |
+
if temporary is not None and info.file_size <= MAX_MEDIA_MEMBER_BYTES:
|
| 38 |
+
return temporary / filename
|
| 39 |
+
return draft / filename
|
TACO/shared-v1.1/script/taco_native_audit.py
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Validate sparse native masks before publishing TACO shared bundles."""
|
| 2 |
+
import argparse
|
| 3 |
+
from collections import Counter
|
| 4 |
+
from concurrent.futures import ProcessPoolExecutor
|
| 5 |
+
import io
|
| 6 |
+
import json
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
from subprocess import TimeoutExpired
|
| 9 |
+
from zipfile import ZipFile
|
| 10 |
+
|
| 11 |
+
import numpy as np
|
| 12 |
+
|
| 13 |
+
from taco_shared import MASK, RAW, WORK, dump, file_hash, json_lines, read_json
|
| 14 |
+
|
| 15 |
+
QUARANTINE=WORK/'native-unattached'
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def evidence(rgb_path,masks,n,size):
|
| 19 |
+
source={'source_shape':list(masks.shape),'source_dtype':str(masks.dtype),'rgb_frames':n}
|
| 20 |
+
if masks.ndim!=3 or masks.shape[0]!=(n+4)//5 or masks.dtype!=np.dtype('uint8'):
|
| 21 |
+
return {**source,'status':'source_shape_or_type_mismatch'}
|
| 22 |
+
w,h=size
|
| 23 |
+
sh,sw=masks.shape[1:]
|
| 24 |
+
if not any((sw*scale,sh*scale)==(w,h) for scale in (1,2,4)):
|
| 25 |
+
return {**source,'status':'unregistered_spatial_grid'}
|
| 26 |
+
from taco_mask_alignment import assess_native_alignment
|
| 27 |
+
return {**source,**assess_native_alignment(rgb_path,masks,n,frame_stride=5)}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def build_aligned(z,member,rgb_path,view,n,size):
|
| 31 |
+
from taco_masks import _build_native_array
|
| 32 |
+
masks=np.load(io.BytesIO(z.read(member)),allow_pickle=False)
|
| 33 |
+
try:
|
| 34 |
+
proof=evidence(rgb_path,masks,n,size)
|
| 35 |
+
except TimeoutExpired:
|
| 36 |
+
print(f'Retrying native alignment after silent FFmpeg output: {member}',flush=True)
|
| 37 |
+
proof=evidence(rgb_path,masks,n,size)
|
| 38 |
+
if proof['status']!='verified':
|
| 39 |
+
return None,{'status':proof['status'],'member':member,'alignment_qa':proof}
|
| 40 |
+
component,details=_build_native_array(masks,member,view,n,*size,frame_stride=5)
|
| 41 |
+
if component:
|
| 42 |
+
component['source_alignment']['method']='per_view_moving_boundary_zero_offset_check'
|
| 43 |
+
return component,{**details,'alignment_qa':proof}
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def mask_match(locator,index):
|
| 47 |
+
return {'source_frame_id':index//5,'source_timestamp_ns':None,'clock_domain':None,
|
| 48 |
+
'match_method':'index_map','delta_ns':None,'source_locator':locator}
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def audit_receipt(args):
|
| 52 |
+
stage,receipt=args
|
| 53 |
+
report=read_json(receipt)
|
| 54 |
+
proof=report['validation'].get('native_segmentation',{})
|
| 55 |
+
if report['variant']!='exo' or proof.get('status')!='verified' or 'alignment_qa' in proof:
|
| 56 |
+
return 'unchanged'
|
| 57 |
+
view=stage/report['view']
|
| 58 |
+
head=view/'metainfo.json'
|
| 59 |
+
meta=read_json(head)
|
| 60 |
+
if file_hash(head)!=report['metainfo_sha256']:
|
| 61 |
+
raise ValueError(f'Staged metadata changed: {head}')
|
| 62 |
+
member=proof['member']
|
| 63 |
+
with ZipFile(RAW/MASK) as z:
|
| 64 |
+
masks=np.load(io.BytesIO(z.read(member)),allow_pickle=False)
|
| 65 |
+
qa=evidence(view/meta['components']['rgb']['data_ref'],masks,meta['num_frames'],meta['camera']['image_size'])
|
| 66 |
+
if qa['status']=='verified':
|
| 67 |
+
native=meta['components']['segment']
|
| 68 |
+
native['source_alignment']['method']='per_view_moving_boundary_zero_offset_check'
|
| 69 |
+
files=view/'camera/frames.jsonl'
|
| 70 |
+
with files.open() as stream:
|
| 71 |
+
frames=[json.loads(line) for line in stream]
|
| 72 |
+
for frame in frames:
|
| 73 |
+
i=frame['frame_index']
|
| 74 |
+
if i%5==0:
|
| 75 |
+
frame['annotation_matches']['native_segmentation']=mask_match(native['source_locator'],i)
|
| 76 |
+
temp=files.with_suffix('.jsonl.next')
|
| 77 |
+
json_lines(temp,frames)
|
| 78 |
+
temp.replace(files)
|
| 79 |
+
report['output_sha256']['camera/frames.jsonl']=file_hash(files)
|
| 80 |
+
verdict='verified'
|
| 81 |
+
else:
|
| 82 |
+
segment=view/'annotation/segment'
|
| 83 |
+
private=QUARANTINE/report['view']/'segment'
|
| 84 |
+
private.parent.mkdir(parents=True,exist_ok=True)
|
| 85 |
+
if segment.is_dir() and not private.exists():
|
| 86 |
+
segment.rename(private)
|
| 87 |
+
elif not (private.is_dir() and not segment.exists()):
|
| 88 |
+
raise ValueError(f'Mask quarantine conflict: {segment}')
|
| 89 |
+
meta['components'].pop('segment')
|
| 90 |
+
report['components'].remove('segment')
|
| 91 |
+
proof['status']=qa['status']
|
| 92 |
+
for key in list(report['output_sha256']):
|
| 93 |
+
if key.startswith('annotation/segment/'):
|
| 94 |
+
expected=report['output_sha256'].pop(key)
|
| 95 |
+
if file_hash(private/Path(key).name)!=expected:
|
| 96 |
+
raise ValueError(f'Staged native mask digest differs: {private}')
|
| 97 |
+
verdict=qa['status']
|
| 98 |
+
proof['alignment_qa']=qa
|
| 99 |
+
dump(head,meta)
|
| 100 |
+
report['metainfo_sha256']=report['output_sha256']['metainfo.json']=file_hash(head)
|
| 101 |
+
dump(receipt,report)
|
| 102 |
+
return verdict
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
if __name__=='__main__':
|
| 106 |
+
p=argparse.ArgumentParser()
|
| 107 |
+
p.add_argument('--stage',type=Path,default=WORK/'builds/shared-v1.1')
|
| 108 |
+
p.add_argument('--workers',type=int,default=5)
|
| 109 |
+
a=p.parse_args()
|
| 110 |
+
receipts=sorted(q for q in (a.stage/'doc/validation').rglob('*.json')
|
| 111 |
+
if q.stem not in ('ego',) and not q.stem.endswith('_marker_removed'))
|
| 112 |
+
counts=Counter()
|
| 113 |
+
with ProcessPoolExecutor(max_workers=a.workers) as pool:
|
| 114 |
+
for i,result in enumerate(pool.map(audit_receipt,[(a.stage,p) for p in receipts],chunksize=1),1):
|
| 115 |
+
counts[result]+=1
|
| 116 |
+
if i%50==0:
|
| 117 |
+
print(i,dict(counts),flush=True)
|
| 118 |
+
print('Native per-view alignment audit',dict(counts),flush=True)
|
TACO/shared-v1.1/script/taco_rgb.py
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Stream-copy RGB into the warehouse and verify frame equivalence."""
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
import json
|
| 5 |
+
from fractions import Fraction
|
| 6 |
+
from functools import lru_cache
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
import subprocess
|
| 9 |
+
import tempfile
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
FFMPEG = ["ffmpeg", "-nostdin", "-loglevel", "error", "-xerror"]
|
| 13 |
+
PIXEL_FIELDS = (
|
| 14 |
+
"codec_name", "width", "height", "pix_fmt", "sample_aspect_ratio",
|
| 15 |
+
"color_range", "color_space", "color_transfer", "color_primaries",
|
| 16 |
+
"chroma_location", "field_order", "extradata_hash",
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def probe(path):
|
| 21 |
+
result = subprocess.check_output([
|
| 22 |
+
"ffprobe", "-v", "error", "-select_streams", "v:0", "-show_packets",
|
| 23 |
+
"-show_streams", "-show_data_hash", "sha256", "-show_entries",
|
| 24 |
+
"stream=avg_frame_rate,time_base," + ",".join(PIXEL_FIELDS)
|
| 25 |
+
+ ":stream_side_data=rotation:packet=pts,data_hash",
|
| 26 |
+
"-of", "json", str(path),
|
| 27 |
+
])
|
| 28 |
+
data = json.loads(result)
|
| 29 |
+
return data["streams"][0], data["packets"]
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def timeline(stream, packets):
|
| 33 |
+
pts = [int(packet["pts"]) for packet in packets]
|
| 34 |
+
if not pts or len(pts) != len(set(pts)):
|
| 35 |
+
raise ValueError("Video does not have unique presentation timestamps")
|
| 36 |
+
order = sorted(range(len(pts)), key=pts.__getitem__)
|
| 37 |
+
time_base = Fraction(stream["time_base"])
|
| 38 |
+
times = [time_base * (pts[i] - pts[order[0]]) for i in order]
|
| 39 |
+
return times, order
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def pixel_hashes(path):
|
| 43 |
+
result = subprocess.check_output(FFMPEG + [
|
| 44 |
+
"-threads", "2", "-noautorotate", "-i", str(path),
|
| 45 |
+
"-map", "0:v:0", "-fps_mode", "passthrough", "-pix_fmt", "rgb24",
|
| 46 |
+
"-c:v", "rawvideo", "-threads", "1", "-f", "framehash", "-",
|
| 47 |
+
], text=True)
|
| 48 |
+
return [line.rsplit(",", 1)[-1].strip() for line in result.splitlines()
|
| 49 |
+
if line and not line.startswith("#")]
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def file_sha256(path):
|
| 53 |
+
digest = hashlib.sha256()
|
| 54 |
+
with path.open("rb") as file:
|
| 55 |
+
for block in iter(lambda: file.read(8 * 1024**2), b""):
|
| 56 |
+
digest.update(block)
|
| 57 |
+
return digest.hexdigest()
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
@lru_cache(maxsize=1)
|
| 61 |
+
def ffmpeg_version():
|
| 62 |
+
return subprocess.check_output(["ffmpeg", "-version"], text=True).splitlines()[0]
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def build_rgb(source_path, view_path, *, source_locator=None):
|
| 66 |
+
"""Return component metadata, verification proof, frame count, size and timing."""
|
| 67 |
+
import torch
|
| 68 |
+
|
| 69 |
+
source_path, view_path = Path(source_path), Path(view_path)
|
| 70 |
+
observation = view_path / "observation"
|
| 71 |
+
observation.mkdir(parents=True, exist_ok=True)
|
| 72 |
+
source, source_packets = probe(source_path)
|
| 73 |
+
original_times, source_order = timeline(source, source_packets)
|
| 74 |
+
with tempfile.TemporaryDirectory(dir=observation, prefix=".rgb-") as tmp:
|
| 75 |
+
stage = Path(tmp)
|
| 76 |
+
target = stage / "rgb.mkv"
|
| 77 |
+
subprocess.run(FFMPEG + [
|
| 78 |
+
"-i", str(source_path), "-map", "0:v:0", "-map_metadata", "-1",
|
| 79 |
+
"-an", "-sn", "-dn", "-c:v", "copy", str(target),
|
| 80 |
+
], check=True)
|
| 81 |
+
target_stream, target_packets = probe(target)
|
| 82 |
+
stored_times, stored_order = timeline(target_stream, target_packets)
|
| 83 |
+
count = len(source_packets)
|
| 84 |
+
size = tuple(source[key] for key in ("width", "height"))
|
| 85 |
+
if len(stored_times) != count or size != tuple(target_stream[key] for key in ("width", "height")):
|
| 86 |
+
raise ValueError(f"RGB remux changed the frame count or dimensions: {source_path}")
|
| 87 |
+
max_drift = max(abs(a - b) for a, b in zip(original_times, stored_times))
|
| 88 |
+
if max_drift > Fraction(target_stream["time_base"]):
|
| 89 |
+
raise ValueError(f"RGB remux changed relative PTS by {float(max_drift)} seconds: {source_path}")
|
| 90 |
+
source_rotation = source.get("side_data_list", [])
|
| 91 |
+
if source_rotation != target_stream.get("side_data_list", []):
|
| 92 |
+
raise ValueError(f"RGB remux changed display rotation: {source_path}")
|
| 93 |
+
packet_hashes = [p.get("data_hash") for p in source_packets]
|
| 94 |
+
identical = (
|
| 95 |
+
all(packet_hashes)
|
| 96 |
+
and source_order == stored_order
|
| 97 |
+
and packet_hashes == [p.get("data_hash") for p in target_packets]
|
| 98 |
+
and all(source.get(k) == target_stream.get(k) for k in PIXEL_FIELDS)
|
| 99 |
+
and source.get("extradata_hash") is not None
|
| 100 |
+
)
|
| 101 |
+
if identical:
|
| 102 |
+
method, hashes = "encoded_packets_extradata_and_presentation_order", packet_hashes
|
| 103 |
+
else:
|
| 104 |
+
method, hashes = "all_decoded_rgb24_frames", pixel_hashes(source_path)
|
| 105 |
+
if len(hashes) != count or hashes != pixel_hashes(target):
|
| 106 |
+
raise ValueError(f"RGB remux changed decoded frames: {source_path}")
|
| 107 |
+
source_rate = Fraction(source["avg_frame_rate"])
|
| 108 |
+
target_rate = Fraction(target_stream["avg_frame_rate"])
|
| 109 |
+
timing = {
|
| 110 |
+
"source_fps": float(source_rate),
|
| 111 |
+
"storage_fps": float(target_rate),
|
| 112 |
+
"source_fps_rational": str(source_rate),
|
| 113 |
+
"storage_fps_rational": str(target_rate),
|
| 114 |
+
"source_times_ns": [round(t * 10**9) for t in original_times],
|
| 115 |
+
"storage_times_ns": [round(t * 10**9) for t in stored_times],
|
| 116 |
+
}
|
| 117 |
+
proof = {
|
| 118 |
+
"method": method,
|
| 119 |
+
"frames": count,
|
| 120 |
+
"max_relative_pts_drift_ns": round(max_drift * 10**9),
|
| 121 |
+
"frame_or_packet_hashes_sha256": hashlib.sha256("\n".join(hashes).encode()).hexdigest(),
|
| 122 |
+
"rgb_mkv_sha256": file_sha256(target),
|
| 123 |
+
}
|
| 124 |
+
valid = stage / "rgb_valid.pt"
|
| 125 |
+
torch.save(torch.ones(count, dtype=torch.bool), valid)
|
| 126 |
+
target.replace(observation / target.name)
|
| 127 |
+
valid.replace(observation / valid.name)
|
| 128 |
+
version = ffmpeg_version()
|
| 129 |
+
return {
|
| 130 |
+
"available": True,
|
| 131 |
+
"schema_id": "rgb/uint8/v1",
|
| 132 |
+
"data_ref": "observation/rgb.mkv",
|
| 133 |
+
"axes": ["T", "height", "width", "channel"],
|
| 134 |
+
"provenance": {"kind": "format_conversion", "method": "Stream-copy the original video into MKV and verify RGB equivalence"},
|
| 135 |
+
"source_locator": source_locator if source_locator is not None else {"file": str(source_path)},
|
| 136 |
+
"valid_ref": "observation/rgb_valid.pt",
|
| 137 |
+
"valid_axes": ["T"],
|
| 138 |
+
"storage": {
|
| 139 |
+
"profile": "mkv/source_copy/v1",
|
| 140 |
+
"codec": target_stream["codec_name"],
|
| 141 |
+
"pixel_format": target_stream["pix_fmt"],
|
| 142 |
+
"encoded_size": list(size),
|
| 143 |
+
"decoder": {
|
| 144 |
+
"name": "ffmpeg",
|
| 145 |
+
"version": version,
|
| 146 |
+
"color_range": target_stream.get("color_range", "unknown"),
|
| 147 |
+
"color_space": target_stream.get("color_space", "unknown"),
|
| 148 |
+
},
|
| 149 |
+
"encoder_parameters": {"mode": "stream_copy"},
|
| 150 |
+
"source_lossy": target_stream["codec_name"] not in {"ffv1", "rawvideo", "png", "huffyuv"},
|
| 151 |
+
},
|
| 152 |
+
"valid_storage": {"profile": "pt/bool_tensor/v1"},
|
| 153 |
+
}, proof, count, size, timing
|
TACO/shared-v1.1/script/taco_shared.py
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Convert pinned TACO v1 archives into the hand warehouse shared-v1.1 layout."""
|
| 2 |
+
import argparse
|
| 3 |
+
from collections import Counter
|
| 4 |
+
from concurrent.futures import ProcessPoolExecutor
|
| 5 |
+
from dataclasses import dataclass
|
| 6 |
+
from functools import lru_cache
|
| 7 |
+
import hashlib
|
| 8 |
+
from itertools import islice
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
from pathlib import Path, PurePosixPath
|
| 12 |
+
import shutil
|
| 13 |
+
import sys
|
| 14 |
+
import tempfile
|
| 15 |
+
import time
|
| 16 |
+
import traceback
|
| 17 |
+
from zipfile import ZipFile
|
| 18 |
+
|
| 19 |
+
WORK=Path(__file__).resolve().parent
|
| 20 |
+
HOME=Path('/home/yanghonglei/TACO')
|
| 21 |
+
RAW=HOME/'raw/data'
|
| 22 |
+
RELEASE='shared-v1.1'
|
| 23 |
+
REFERENCE=Path('/data/xuzhefeng/Datasets/Hand-Datasets-Raw/dex-ycb/shared-v1.1/doc')
|
| 24 |
+
TOOLS='/data/yanghonglei/hand-warehouse-1.1/tools'
|
| 25 |
+
DEPTH='Egocentric_Depth_Videos.zip'
|
| 26 |
+
MASK='2D_Segmentation.zip'
|
| 27 |
+
LISTS=WORK/'data_lists'
|
| 28 |
+
SPLIT_FILE='v1_overall_data_train_test_split.txt'
|
| 29 |
+
EXO='Allocentric_RGB_Videos'
|
| 30 |
+
MARKER='Marker_Removed_Allocentric_RGB_Videos'
|
| 31 |
+
EGO='Egocentric_RGB_Videos.zip'
|
| 32 |
+
BASELINE_FILES=('Allocentric_Camera_Parameters.zip','Egocentric_Camera_Parameters.zip',
|
| 33 |
+
'Hand_Poses.zip','Object_Models.zip','Object_Poses.zip')
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
@dataclass(frozen=True)
|
| 37 |
+
class Job:
|
| 38 |
+
archive: str
|
| 39 |
+
member: str
|
| 40 |
+
triplet: str
|
| 41 |
+
sequence: str
|
| 42 |
+
camera: str
|
| 43 |
+
variant: str
|
| 44 |
+
|
| 45 |
+
@property
|
| 46 |
+
def group(self):
|
| 47 |
+
return f'{self.triplet}__{self.sequence}'
|
| 48 |
+
|
| 49 |
+
@property
|
| 50 |
+
def camera_id(self):
|
| 51 |
+
return f'{self.camera}_marker_removed' if self.variant=='marker_removed' else self.camera
|
| 52 |
+
|
| 53 |
+
@property
|
| 54 |
+
def view(self):
|
| 55 |
+
return f'data/{self.group}/{self.camera_id}'
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def read_json(path):
|
| 59 |
+
return json.loads(path.read_text(encoding='utf-8'))
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def json_lines(path,rows):
|
| 63 |
+
with path.open('w',encoding='utf-8') as target:
|
| 64 |
+
for row in rows:
|
| 65 |
+
target.write(json.dumps(row,ensure_ascii=False,allow_nan=False)+'\n')
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def dump(path,obj):
|
| 69 |
+
tmp=path.with_name(path.name+'.tmp')
|
| 70 |
+
tmp.write_text(json.dumps(obj,ensure_ascii=False,indent=2,allow_nan=False)+'\n',encoding='utf-8')
|
| 71 |
+
tmp.replace(path)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def file_hash(path):
|
| 75 |
+
value=hashlib.sha256()
|
| 76 |
+
with path.open('rb') as f:
|
| 77 |
+
while data:=f.read(8*1024**2):
|
| 78 |
+
value.update(data)
|
| 79 |
+
return value.hexdigest()
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
@lru_cache(maxsize=6)
|
| 83 |
+
def archive(name):
|
| 84 |
+
return ZipFile(RAW/name)
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def official():
|
| 88 |
+
inventory={}
|
| 89 |
+
paths={'exo':'v1_overall_data_sequences.txt','ego':'v1_egocentric_data_available_sequences.txt',
|
| 90 |
+
'marker_removed':'v1_marker_removed_data_available_sequences.txt'}
|
| 91 |
+
for key,name in paths.items():
|
| 92 |
+
records=[tuple(line.rsplit(maxsplit=1)) for line in (LISTS/name).read_text(encoding='utf-8-sig').splitlines() if line.strip()]
|
| 93 |
+
if len(records)!=len(set(records)):
|
| 94 |
+
raise ValueError(f'Duplicate official sequence {name}')
|
| 95 |
+
inventory[key]=set(records)
|
| 96 |
+
splits=dict(row.split(',') for row in (LISTS/SPLIT_FILE).read_text(encoding='utf-8-sig').splitlines() if row.strip())
|
| 97 |
+
if set(splits)!={seq for _,seq in inventory['exo']} or set(splits.values())!={'train','test_1','test_2','test_3','test_4'}:
|
| 98 |
+
raise ValueError('Official split and sequence lists disagree')
|
| 99 |
+
return inventory,splits
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
def jobs_for(name,inventory):
|
| 103 |
+
group,_,file=name.partition('/')
|
| 104 |
+
variant='ego' if name==EGO else 'marker_removed' if group==MARKER else 'exo'
|
| 105 |
+
expected=inventory[variant]
|
| 106 |
+
output,extra=[],[]
|
| 107 |
+
with ZipFile(RAW/name) as z:
|
| 108 |
+
for member in z.infolist():
|
| 109 |
+
p=PurePosixPath(member.filename)
|
| 110 |
+
if member.is_dir() or p.suffix.lower()!='.mp4' or '__MACOSX' in p.parts or '.AppleDouble' in p.parts:
|
| 111 |
+
continue
|
| 112 |
+
if len(p.parts)<3 or p.is_absolute() or '..' in p.parts:
|
| 113 |
+
raise ValueError(f'Invalid video ZIP member: {name}:{p}')
|
| 114 |
+
triplet,sequence,filename=p.parts[-3:]
|
| 115 |
+
camera='ego' if variant=='ego' else PurePosixPath(filename).stem
|
| 116 |
+
if (variant=='ego' and filename!='color.mp4') or (variant!='ego' and camera+'.zip'!=file):
|
| 117 |
+
raise ValueError(f'Unexpected video identity: {name}:{p}')
|
| 118 |
+
if (triplet,sequence) not in expected:
|
| 119 |
+
extra.append({'archive':name,'member':member.filename})
|
| 120 |
+
continue
|
| 121 |
+
output.append(Job(name,member.filename,triplet,sequence,camera,variant))
|
| 122 |
+
if len({j.view for j in output})!=len(output):
|
| 123 |
+
raise ValueError(f'Duplicate view in {name}')
|
| 124 |
+
covered={(j.triplet,j.sequence) for j in output}
|
| 125 |
+
if covered!=expected:
|
| 126 |
+
missing=sorted(expected-covered)
|
| 127 |
+
raise ValueError(f'Official sequences missing from {name}: {len(missing)}, first {missing[:5]}')
|
| 128 |
+
return output,extra
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
@lru_cache(maxsize=1)
|
| 132 |
+
def sidecar_indices():
|
| 133 |
+
depth={}
|
| 134 |
+
for member in archive(DEPTH).namelist() if (RAW/DEPTH).is_file() else ():
|
| 135 |
+
p=PurePosixPath(member)
|
| 136 |
+
if p.name=='egocentric_depth.avi' and '__MACOSX' not in p.parts:
|
| 137 |
+
key=tuple(p.parts[-3:-1])
|
| 138 |
+
if key in depth:
|
| 139 |
+
raise ValueError(f'Duplicate ego depth: {p}')
|
| 140 |
+
depth[key]=member
|
| 141 |
+
return depth
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
def locator(file,member):
|
| 145 |
+
return {'file':f'raw/data/{file}','member':member}
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
def materialize(file,member,out):
|
| 149 |
+
with archive(file).open(member) as src,out.open('wb') as dst:
|
| 150 |
+
shutil.copyfileobj(src,dst,8*1024*1024)
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
@lru_cache(maxsize=1)
|
| 154 |
+
def annotations_index():
|
| 155 |
+
from taco_annotations import open_index
|
| 156 |
+
return open_index(RAW,WORK/'asset-cache')
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
def result_file(stage,job):
|
| 160 |
+
return stage/'doc/validation'/job.group/f'{job.camera_id}.json'
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
def build_view(args, annotation_builder=None):
|
| 164 |
+
from taco_media_scratch import source_media_workspace
|
| 165 |
+
with source_media_workspace() as temporary:
|
| 166 |
+
return _build_view(args, temporary, annotation_builder)
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
def _build_view(args, temporary, annotation_builder):
|
| 170 |
+
from taco_media_scratch import pick_media_path
|
| 171 |
+
job,stage,split=args
|
| 172 |
+
from taco_annotations import make_annotations
|
| 173 |
+
from taco_depth import UnalignedDepth,build_depth
|
| 174 |
+
from taco_rgb import build_rgb
|
| 175 |
+
from torch import set_num_threads
|
| 176 |
+
|
| 177 |
+
set_num_threads(1)
|
| 178 |
+
view=stage/job.view
|
| 179 |
+
receipt=result_file(stage,job)
|
| 180 |
+
if view.is_dir() and receipt.is_file():
|
| 181 |
+
old=read_json(receipt)
|
| 182 |
+
if old['source']!=locator(job.archive,job.member) or file_hash(view/'metainfo.json')!=old['metainfo_sha256']:
|
| 183 |
+
raise ValueError(f'Existing verified view has a different source: {view}')
|
| 184 |
+
for name,expected in old['output_sha256'].items():
|
| 185 |
+
if file_hash(view/name) != expected:
|
| 186 |
+
raise ValueError(f'Existing verified output size differs: {view/name}')
|
| 187 |
+
return old
|
| 188 |
+
if view.exists() or receipt.exists():
|
| 189 |
+
raise ValueError(f'Incomplete output requiring review: {view}')
|
| 190 |
+
scratch=WORK/'view-scratch'
|
| 191 |
+
scratch.mkdir(parents=True,exist_ok=True)
|
| 192 |
+
draft=Path(tempfile.mkdtemp(prefix='taco-',dir=scratch))
|
| 193 |
+
out=draft/'view'
|
| 194 |
+
out.mkdir()
|
| 195 |
+
rgb_file=pick_media_path(archive(job.archive).getinfo(job.member), 'source-rgb.mp4', draft, temporary)
|
| 196 |
+
source=locator(job.archive,job.member)
|
| 197 |
+
materialize(job.archive,job.member,rgb_file)
|
| 198 |
+
rgb,rgb_proof,n,size,timing=build_rgb(rgb_file,out,source_locator=source)
|
| 199 |
+
if n<1:
|
| 200 |
+
raise ValueError(f'No RGB frames in {source}')
|
| 201 |
+
if annotation_builder is None:
|
| 202 |
+
meta_components,cam=make_annotations((job.triplet,job.sequence),job.camera,n,out,annotations_index(),size=size,
|
| 203 |
+
rectified=False)
|
| 204 |
+
else:
|
| 205 |
+
meta_components,cam=annotation_builder(job,out,n,size,timing)
|
| 206 |
+
components={'rgb':rgb,**meta_components}
|
| 207 |
+
proofs={'rgb':rgb_proof}
|
| 208 |
+
depth_member=sidecar_indices().get((job.triplet,job.sequence)) if job.variant=='ego' else None
|
| 209 |
+
if job.variant=='ego' and depth_member is None:
|
| 210 |
+
proofs['depth']={'status':'source_depth_member_absent'}
|
| 211 |
+
if depth_member:
|
| 212 |
+
depth_file=pick_media_path(archive(DEPTH).getinfo(depth_member), 'source-depth.avi', draft, temporary)
|
| 213 |
+
depth_locator=locator(DEPTH,depth_member)
|
| 214 |
+
materialize(DEPTH,depth_member,depth_file)
|
| 215 |
+
try:
|
| 216 |
+
components['depth'],proofs['depth']=build_depth(depth_file,out,n,size,depth_locator)
|
| 217 |
+
except UnalignedDepth as error:
|
| 218 |
+
proofs['depth']={**error.proof,'source_locator':depth_locator}
|
| 219 |
+
for name in ('depth.mkv','depth_valid.mkv'):
|
| 220 |
+
partial=out/'observation'/name
|
| 221 |
+
if partial.is_file():
|
| 222 |
+
partial.unlink()
|
| 223 |
+
if job.variant=='exo':
|
| 224 |
+
member=f'2D_Segmentation/{job.triplet}/{job.sequence}/{job.camera}_masks.npy'
|
| 225 |
+
if member not in archive(MASK).NameToInfo:
|
| 226 |
+
raise ValueError(f'Official source mask member missing: {member}')
|
| 227 |
+
from taco_native_audit import build_aligned
|
| 228 |
+
native,mask_proof=build_aligned(archive(MASK),member,rgb_file,out,n,size)
|
| 229 |
+
if native:
|
| 230 |
+
components['segment']=native
|
| 231 |
+
proofs['native_segmentation']=mask_proof
|
| 232 |
+
|
| 233 |
+
pose_locator=components.get('mano',{}).get('source_locator')
|
| 234 |
+
native_locator=components.get('segment',{}).get('source_locator')
|
| 235 |
+
def frame_record(i):
|
| 236 |
+
matches={}
|
| 237 |
+
if pose_locator:
|
| 238 |
+
matches['mano']={'source_frame_id':f'{i+1:05d}','source_timestamp_ns':None,'clock_domain':None,
|
| 239 |
+
'match_method':'index_map','delta_ns':None,'source_locator':pose_locator}
|
| 240 |
+
if native_locator and i%5==0:
|
| 241 |
+
from taco_native_audit import mask_match
|
| 242 |
+
matches['native_segmentation']=mask_match(native_locator,i)
|
| 243 |
+
if 'depth' in components:
|
| 244 |
+
matches['depth']={'source_frame_id':i,'source_timestamp_ns':None,'clock_domain':None,
|
| 245 |
+
'match_method':'index_map','delta_ns':None,'source_locator':locator(DEPTH,depth_member)}
|
| 246 |
+
return {'frame_index':i,'source_frame_id':i,'timestamp_ns':timing['source_times_ns'][i],
|
| 247 |
+
'clock_domain':'clip_presentation_relative','sync_id':f'{job.sequence}/{i}',
|
| 248 |
+
'source_locator':{**source,'video_frame_index':i},'annotation_matches':matches}
|
| 249 |
+
|
| 250 |
+
(out/'camera').mkdir(exist_ok=True)
|
| 251 |
+
json_lines(out/'camera/frames.jsonl',(frame_record(i) for i in range(n)))
|
| 252 |
+
meta={'schema_version':'hand-warehouse/1.1','dataset_id':'TACO','release_id':RELEASE,
|
| 253 |
+
'sequence_id':job.group,'camera_id':job.camera_id,'sample_type':'video','num_frames':n,
|
| 254 |
+
'hand_slots':['left','right'],'sampling':{'type':'dense','source_fps':timing['source_fps'],
|
| 255 |
+
'storage_fps':timing['storage_fps'],'source_fps_rational':timing['source_fps_rational'],
|
| 256 |
+
'storage_fps_rational':timing['storage_fps_rational'],'timebase_role':'index_only',
|
| 257 |
+
'frames_ref':'camera/frames.jsonl','selection':'All presentation frames in the official RGB member'},
|
| 258 |
+
'camera':cam,'components':components,'split':'train' if split=='train' else 'test',
|
| 259 |
+
'split_scheme':'TACO v1 official train/test_1–test_4','official_split':split,
|
| 260 |
+
'split_source_locator':{'url':'https://github.com/leolyliu/TACO-Instructions/blob/fd3b5a6b39565ca6935a91d35d5e91dde03c5142/data_lists/'+SPLIT_FILE},
|
| 261 |
+
'view_type':'ego' if job.variant=='ego' else 'exo','source_camera_id':job.camera,
|
| 262 |
+
'source_sequence_id':job.sequence,'source_triplet':job.triplet,'video_variant':job.variant}
|
| 263 |
+
dump(out/'metainfo.json',meta)
|
| 264 |
+
output_sha256={}
|
| 265 |
+
for path in out.rglob('*'):
|
| 266 |
+
if path.is_file():
|
| 267 |
+
relative=path.relative_to(out).as_posix()
|
| 268 |
+
output_sha256[relative]=rgb_proof['rgb_mkv_sha256'] if relative==rgb['data_ref'] else file_hash(path)
|
| 269 |
+
report={'status':'verified','view':job.view,'source':source,'frames':n,'split':split,
|
| 270 |
+
'variant':job.variant,'components':list(components),'validation':proofs,
|
| 271 |
+
'metainfo_sha256':file_hash(out/'metainfo.json'),
|
| 272 |
+
'output_sha256':output_sha256}
|
| 273 |
+
view.parent.mkdir(parents=True,exist_ok=True)
|
| 274 |
+
receipt.parent.mkdir(parents=True,exist_ok=True)
|
| 275 |
+
out.rename(view)
|
| 276 |
+
dump(receipt,report)
|
| 277 |
+
rgb_file.unlink()
|
| 278 |
+
if depth_member:
|
| 279 |
+
depth_file.unlink()
|
| 280 |
+
draft.rmdir()
|
| 281 |
+
return report
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
def source_names(snapshot):
|
| 285 |
+
return [x['rfilename'] for x in snapshot['siblings']
|
| 286 |
+
if x['rfilename']==EGO or x['rfilename'].split('/')[0] in (EXO,MARKER)]
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
def check_full(reports,selected,inventory):
|
| 290 |
+
if len(reports)!=len(selected) or set(reports)!=set(selected):
|
| 291 |
+
raise ValueError('View output inventory differs from source inventory')
|
| 292 |
+
observed={variant:{(j.triplet,j.sequence) for j in selected.values() if j.variant==variant}
|
| 293 |
+
for variant in inventory}
|
| 294 |
+
if observed!=inventory:
|
| 295 |
+
raise ValueError(f'Official sequence coverage differs: '+str({k:(len(observed[k]),len(v)) for k,v in inventory.items()}))
|
| 296 |
+
|
| 297 |
+
|
| 298 |
+
def publish(stage,reports,extras,available,snapshot,started,pilot):
|
| 299 |
+
doc=stage/'doc'
|
| 300 |
+
for name in ('schema.json','CONTRACT.md'):
|
| 301 |
+
shutil.copyfile(REFERENCE/name,doc/name)
|
| 302 |
+
shutil.copytree(LISTS,doc/'source-lists',dirs_exist_ok=True)
|
| 303 |
+
shutil.copyfile(WORK/'source.json',doc/'SOURCE.json')
|
| 304 |
+
script=stage/'script'
|
| 305 |
+
script.mkdir(exist_ok=True)
|
| 306 |
+
for path in ('taco_shared.py','taco_rgb.py','taco_depth.py','taco_annotations.py','taco_masks.py','taco_sparse_ffv1.py','taco_native_audit.py','taco_mask_alignment.py',
|
| 307 |
+
'taco_fast_depth.py','taco_hands_cache.py','taco_media_scratch.py'):
|
| 308 |
+
shutil.copyfile(WORK/path,script/path)
|
| 309 |
+
json_lines(doc/'VIEW_MANIFEST.jsonl',(reports[k] for k in sorted(reports)))
|
| 310 |
+
json_lines(doc/'ARCHIVE_ONLY_VIDEOS.jsonl',extras)
|
| 311 |
+
doc_text=(
|
| 312 |
+
'# TACO shared-v1.1\n\n'
|
| 313 |
+
'Source SHA '+snapshot['sha']+'\n\n'
|
| 314 |
+
'The archive ZIPs and the source snapshot are in the sibling raw directory. Each view preserves full RGB '
|
| 315 |
+
'presentation order, camera and triplet IDs and the official train/test subset in metadata. '
|
| 316 |
+
'The marker-removed alternate is a separate view with the same physical camera ID. '
|
| 317 |
+
'Use the original views for source native segmentation and the ego views for measured depth. '
|
| 318 |
+
'Original 2D arrays are attached only after a per-view zero-offset moving-boundary check. '
|
| 319 |
+
'Views with inconclusive or inconsistent mapping retain the original arrays in raw. '
|
| 320 |
+
'Ego depth is attached only when the decoded storage precision, RGB pixel grid and frame count agree. '
|
| 321 |
+
'The receipts identify depth excluded because registration or source frame correspondence could not be verified.\n\n'
|
| 322 |
+
'Bundle fields follow the declared per-view schemas. See each validation record for exact source member, '
|
| 323 |
+
'pixel and timing verification, and the handling of the native 2D annotation.\n')
|
| 324 |
+
(doc/'RAW_TO_SHARED.md').write_text(doc_text,encoding='utf-8')
|
| 325 |
+
sys.path.insert(0,TOOLS)
|
| 326 |
+
from validate_v1_1 import check_conformance,check_references
|
| 327 |
+
from registry_v1_1 import Registry
|
| 328 |
+
registry=Registry.load(doc/'schema.json')
|
| 329 |
+
native_status=Counter()
|
| 330 |
+
for report in reports.values():
|
| 331 |
+
native=report['validation'].get('native_segmentation')
|
| 332 |
+
if native is None:
|
| 333 |
+
continue
|
| 334 |
+
status=native['status']
|
| 335 |
+
native_status[status]+=1
|
| 336 |
+
if not pilot and status=='verified' and native.get('alignment_qa',{}).get('status')!='verified':
|
| 337 |
+
raise ValueError(f"Native mask has no per-view time alignment proof: {report['view']}")
|
| 338 |
+
depth_status=Counter(report['validation']['depth'].get('status','verified')
|
| 339 |
+
for report in reports.values() if report['variant']=='ego')
|
| 340 |
+
proof={'depth_status':dict(depth_status),'native_mask_status':dict(native_status),'status':'passed','phase':'pilot' if pilot else 'full','dataset':'TACO','release':RELEASE,
|
| 341 |
+
'revision':snapshot['sha'],'views':len(reports),'frames':sum(r['frames'] for r in reports.values()),
|
| 342 |
+
'views_by_variant':dict(Counter(r['variant'] for r in reports.values())),
|
| 343 |
+
'frames_by_variant':dict(Counter({v:sum(r['frames'] for r in reports.values() if r['variant']==v)
|
| 344 |
+
for v in ('exo','ego','marker_removed')})),
|
| 345 |
+
'video_archives':available,'archive_only_video_members':len(extras),'seconds':round(time.monotonic()-started,2)}
|
| 346 |
+
for check in (check_references,check_conformance):
|
| 347 |
+
errors,stats=check(str(stage),registry)
|
| 348 |
+
if errors:
|
| 349 |
+
dump(doc/'CONFORMANCE_FAILURES.json',errors)
|
| 350 |
+
raise ValueError(f'{check.__name__} failed: {errors[:4]}')
|
| 351 |
+
proof[check.__name__]=stats
|
| 352 |
+
dump(doc/'VALIDATION.json',proof)
|
| 353 |
+
if not pilot:
|
| 354 |
+
target=HOME/RELEASE
|
| 355 |
+
if target.exists():
|
| 356 |
+
raise FileExistsError(target)
|
| 357 |
+
stage.rename(target)
|
| 358 |
+
print(json.dumps(proof,ensure_ascii=False),flush=True)
|
| 359 |
+
|
| 360 |
+
|
| 361 |
+
def main():
|
| 362 |
+
parser=argparse.ArgumentParser()
|
| 363 |
+
parser.add_argument('--watch',action='store_true')
|
| 364 |
+
parser.add_argument('--pilot',action='store_true')
|
| 365 |
+
parser.add_argument('--workers',type=int,default=6)
|
| 366 |
+
params=parser.parse_args()
|
| 367 |
+
started=time.monotonic()
|
| 368 |
+
snapshot=read_json(WORK/'source.json')
|
| 369 |
+
inventory,splits=official()
|
| 370 |
+
assert {k:len(v) for k,v in inventory.items()}=={'exo':2317,'ego':2212,'marker_removed':2120}
|
| 371 |
+
stage=WORK/'builds'/(RELEASE+('-pilot' if params.pilot else ''))
|
| 372 |
+
(stage/'doc/validation').mkdir(parents=True,exist_ok=True)
|
| 373 |
+
all_names=source_names(snapshot)
|
| 374 |
+
done=set()
|
| 375 |
+
pending={}
|
| 376 |
+
reports={}
|
| 377 |
+
selected={}
|
| 378 |
+
extras=[]
|
| 379 |
+
# Recheck raw archives between bounded waves so aligned ego can feed segment first.
|
| 380 |
+
with ProcessPoolExecutor(max_workers=params.workers) as pool:
|
| 381 |
+
while len(done)<len(all_names):
|
| 382 |
+
if all((RAW/f).is_file() for f in BASELINE_FILES):
|
| 383 |
+
names=[name for name in all_names if name not in done and name not in pending and (RAW/name).is_file()
|
| 384 |
+
and (name!=EGO or (RAW/DEPTH).is_file())
|
| 385 |
+
and (name.split('/')[0]!=EXO or
|
| 386 |
+
((RAW/MASK).is_file() and (WORK/'native-mask-policy-ready').is_file()))]
|
| 387 |
+
for name in names:
|
| 388 |
+
jobs,new_extra=jobs_for(name,inventory)
|
| 389 |
+
if params.pilot:
|
| 390 |
+
jobs=jobs[:1]
|
| 391 |
+
for job in jobs:
|
| 392 |
+
if job.view in selected:
|
| 393 |
+
raise ValueError(f'Duplicate cross-archive view: {job.view}')
|
| 394 |
+
selected[job.view]=job
|
| 395 |
+
pending[name]=iter(jobs)
|
| 396 |
+
extras.extend(new_extra)
|
| 397 |
+
print(json.dumps({'archive':name,'queued':len(jobs)}),flush=True)
|
| 398 |
+
if not pending:
|
| 399 |
+
if not params.watch:
|
| 400 |
+
break
|
| 401 |
+
owner=WORK/'download.pid'
|
| 402 |
+
if not (HOME/'raw/doc/TRANSFER.json').is_file() and owner.is_file():
|
| 403 |
+
proc=Path('/proc')/owner.read_text().strip()/'stat'
|
| 404 |
+
if not proc.exists() or proc.read_text().split(') ',1)[1].startswith('Z '):
|
| 405 |
+
raise RuntimeError('Download stopped before the remaining archives arrived')
|
| 406 |
+
time.sleep(30)
|
| 407 |
+
continue
|
| 408 |
+
name=EGO if EGO in pending else next(iter(pending))
|
| 409 |
+
wave=list(islice(pending[name],32))
|
| 410 |
+
if not wave:
|
| 411 |
+
pending.pop(name)
|
| 412 |
+
done.add(name)
|
| 413 |
+
continue
|
| 414 |
+
for report in pool.map(build_view,[(job,stage,splits[job.sequence]) for job in wave],chunksize=1):
|
| 415 |
+
reports[report['view']]=report
|
| 416 |
+
if params.pilot or len(reports)%50==0:
|
| 417 |
+
print(json.dumps({'done':len(reports),'latest':report['view'],'frames':report['frames']},ensure_ascii=False),flush=True)
|
| 418 |
+
if params.pilot:
|
| 419 |
+
done.add(name)
|
| 420 |
+
break
|
| 421 |
+
if params.pilot:
|
| 422 |
+
if not reports:
|
| 423 |
+
raise RuntimeError('Pilot inputs are not ready')
|
| 424 |
+
publish(stage,reports,extras,sorted(done),snapshot,started,True)
|
| 425 |
+
else:
|
| 426 |
+
if done!=set(all_names) or not (HOME/'raw/doc/TRANSFER.json').is_file():
|
| 427 |
+
raise RuntimeError(f'Raw snapshot incomplete; converted {len(reports)} staged views')
|
| 428 |
+
check_full(reports,selected,inventory)
|
| 429 |
+
publish(stage,reports,extras,sorted(done),snapshot,started,False)
|
| 430 |
+
|
| 431 |
+
|
| 432 |
+
if __name__=='__main__':
|
| 433 |
+
main()
|
TACO/shared-v1.1/script/taco_sparse_ffv1.py
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Sparse FFV1 encoder with verified independent packet repetition."""
|
| 2 |
+
|
| 3 |
+
from fractions import Fraction
|
| 4 |
+
import hashlib
|
| 5 |
+
import json
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import subprocess
|
| 8 |
+
import tempfile
|
| 9 |
+
import time
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
FFMPEG = ["ffmpeg", "-nostdin", "-loglevel", "error", "-xerror"]
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class SparsePacketUnsupported(ValueError):
|
| 16 |
+
"""An encoder/muxer result requires the dense lossless fallback."""
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
def probe(path):
|
| 20 |
+
result = json.loads(subprocess.check_output([
|
| 21 |
+
"ffprobe", "-v", "error", "-select_streams", "v:0", "-show_data_hash", "sha256",
|
| 22 |
+
"-show_entries", "stream=codec_name,pix_fmt,width,height,time_base,extradata_hash:packet=pts,flags,data_hash",
|
| 23 |
+
"-of", "json", str(path),
|
| 24 |
+
]))
|
| 25 |
+
return result["streams"][0],result["packets"]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def write_ffv1(path, frames, width, height, fmt, fps, independent):
|
| 29 |
+
codec = ["-c:v", "ffv1", "-threads", "1", "-pix_fmt", fmt]
|
| 30 |
+
if independent:
|
| 31 |
+
codec.extend(["-g", "1", "-level", "3", "-slicecrc", "1"])
|
| 32 |
+
with subprocess.Popen(FFMPEG + [
|
| 33 |
+
"-f", "rawvideo", "-pix_fmt", fmt, "-video_size", f"{width}x{height}",
|
| 34 |
+
"-framerate", str(fps), "-i", "pipe:0", *codec, str(path),
|
| 35 |
+
], stdin=subprocess.PIPE) as process:
|
| 36 |
+
expected_len = width*height*(2 if fmt=="gray16le" else 1)
|
| 37 |
+
for frame in frames:
|
| 38 |
+
if len(frame)!=expected_len:
|
| 39 |
+
raise ValueError(f"Frame size {len(frame)} differs from {expected_len}")
|
| 40 |
+
process.stdin.write(frame)
|
| 41 |
+
process.stdin.close()
|
| 42 |
+
if process.wait()!=0:
|
| 43 |
+
raise RuntimeError(f"FFV1 encode failed: {path}")
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def decoded(path, fmt, frame_bytes):
|
| 47 |
+
hashes = hashlib.sha256()
|
| 48 |
+
count = 0
|
| 49 |
+
with subprocess.Popen(FFMPEG + [
|
| 50 |
+
"-threads", "1", "-i", str(path), "-map", "0:v:0", "-fps_mode", "passthrough",
|
| 51 |
+
"-pix_fmt", fmt, "-f", "rawvideo", "-threads", "1", "pipe:1",
|
| 52 |
+
], stdout=subprocess.PIPE) as process:
|
| 53 |
+
while raw:=process.stdout.read(frame_bytes):
|
| 54 |
+
if len(raw)!=frame_bytes:
|
| 55 |
+
raise ValueError(f"Truncated decoded frame: {path}")
|
| 56 |
+
hashes.update(raw)
|
| 57 |
+
count += 1
|
| 58 |
+
if process.wait()!=0:
|
| 59 |
+
raise RuntimeError(f"FFV1 decode failed: {path}")
|
| 60 |
+
return count,hashes.hexdigest()
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def build_sparse(path, width, height, fmt, fps, frame_count, valid_indices, read_mask):
|
| 64 |
+
"""Render one blank and each valid mask, prove the complete packet sequence."""
|
| 65 |
+
path = Path(path).resolve()
|
| 66 |
+
fps = Fraction(fps)
|
| 67 |
+
valid_indices = tuple(valid_indices)
|
| 68 |
+
if fmt not in ("gray","gray16le") or not 0<fps<=1000 or frame_count<=0:
|
| 69 |
+
raise ValueError("Unexpected mask format, rate or frame count")
|
| 70 |
+
if list(valid_indices)!=sorted(set(valid_indices)) or any(i<0 or i>=frame_count for i in valid_indices):
|
| 71 |
+
raise ValueError("Mask indices must be unique, sorted, and lie within the view")
|
| 72 |
+
zero = bytes(width*height*(2 if fmt=="gray16le" else 1))
|
| 73 |
+
started = time.monotonic()
|
| 74 |
+
with tempfile.TemporaryDirectory(dir=path.parent,prefix=".sparse-ffv1.") as folder:
|
| 75 |
+
work = Path(folder)
|
| 76 |
+
compact = work/"compact.mkv"
|
| 77 |
+
source_hash = hashlib.sha256()
|
| 78 |
+
def frames():
|
| 79 |
+
for raw in (zero,):
|
| 80 |
+
source_hash.update(raw)
|
| 81 |
+
yield raw
|
| 82 |
+
for index in valid_indices:
|
| 83 |
+
raw = read_mask(index)
|
| 84 |
+
source_hash.update(raw)
|
| 85 |
+
yield raw
|
| 86 |
+
write_ffv1(compact,frames(),width,height,fmt,fps,independent=True)
|
| 87 |
+
count,decoded_hash = decoded(compact,fmt,len(zero))
|
| 88 |
+
if count!=1+len(valid_indices) or decoded_hash!=source_hash.hexdigest():
|
| 89 |
+
raise ValueError("Independent packets failed pixel comparison")
|
| 90 |
+
compact_stream,compact_packets=probe(compact)
|
| 91 |
+
if not all("K" in packet["flags"] for packet in compact_packets):
|
| 92 |
+
raise SparsePacketUnsupported("Compact stream contains a dependent packet")
|
| 93 |
+
if valid_indices:
|
| 94 |
+
boundaries=",".join(str(i) for i in range(1,count))
|
| 95 |
+
subprocess.run(FFMPEG + [
|
| 96 |
+
"-i",str(compact),"-map","0:v:0","-c:v","copy","-f","segment",
|
| 97 |
+
"-segment_frames",boundaries,"-reset_timestamps","1",str(work/"packet-%05d.mkv"),
|
| 98 |
+
],check=True)
|
| 99 |
+
else:
|
| 100 |
+
compact.rename(work/"packet-00000.mkv")
|
| 101 |
+
mapping = dict(zip(valid_indices,range(1,count)))
|
| 102 |
+
concat=work/"index.ffconcat"
|
| 103 |
+
def milliseconds(microseconds):
|
| 104 |
+
return f"{microseconds//1000000}.{microseconds%1000000:06d}"
|
| 105 |
+
with concat.open("w",encoding="ascii") as file:
|
| 106 |
+
file.write("ffconcat version 1.0\n")
|
| 107 |
+
for index in range(frame_count):
|
| 108 |
+
duration=(1_000_000*(index+1))//fps-(1_000_000*index)//fps
|
| 109 |
+
file.write(f"file packet-{mapping.get(index,0):05d}.mkv\nduration {milliseconds(duration)}\n")
|
| 110 |
+
output=work/"sparse.mkv"
|
| 111 |
+
subprocess.run(FFMPEG + [
|
| 112 |
+
"-f","concat","-safe","1","-i",str(concat),"-map","0:v:0","-c:v","copy",str(output),
|
| 113 |
+
],check=True)
|
| 114 |
+
final_stream,final_packets=probe(output)
|
| 115 |
+
actual=[packet["data_hash"] for packet in final_packets]
|
| 116 |
+
expected=[compact_packets[mapping.get(i,0)]["data_hash"] for i in range(frame_count)]
|
| 117 |
+
timestamps=[int(packet["pts"]) for packet in final_packets]
|
| 118 |
+
time_base=Fraction(final_stream["time_base"])
|
| 119 |
+
if (actual!=expected or not all("K" in p["flags"] for p in final_packets)
|
| 120 |
+
or not compact_stream.get("extradata_hash")
|
| 121 |
+
or final_stream!=compact_stream
|
| 122 |
+
or timestamps!=[round(i/(fps*time_base)) for i in range(frame_count)]):
|
| 123 |
+
raise SparsePacketUnsupported("Final FFV1 packet, header, or timestamp sequence failed validation")
|
| 124 |
+
output.replace(path)
|
| 125 |
+
return {"frames":frame_count,"valid_frames":len(valid_indices), "independent_raw_frames":count,
|
| 126 |
+
"independent_decoded_sha256":decoded_hash,
|
| 127 |
+
"verified_packet_sequence_sha256":hashlib.sha256("\n".join(expected).encode()).hexdigest(),
|
| 128 |
+
"elapsed_seconds":time.monotonic()-started}
|