Release v1.0.0: verified Level 1 preprocessing assets
Browse files- CHANGELOG.md +5 -0
- README.md +122 -0
- SHA256SUMS +31 -0
- level1/README.md +21 -0
- level1/audio/motion_instructions/data.parquet +3 -0
- level1/image/img_txt_human/index.parquet +3 -0
- level1/image/img_txt_human/videos-00000-of-00005.index.parquet +3 -0
- level1/image/img_txt_human/videos-00000-of-00005.tar +3 -0
- level1/image/img_txt_human/videos-00001-of-00005.index.parquet +3 -0
- level1/image/img_txt_human/videos-00001-of-00005.tar +3 -0
- level1/image/img_txt_human/videos-00002-of-00005.index.parquet +3 -0
- level1/image/img_txt_human/videos-00002-of-00005.tar +3 -0
- level1/image/img_txt_human/videos-00003-of-00005.index.parquet +3 -0
- level1/image/img_txt_human/videos-00003-of-00005.tar +3 -0
- level1/image/img_txt_human/videos-00004-of-00005.index.parquet +3 -0
- level1/image/img_txt_human/videos-00004-of-00005.tar +3 -0
- level1/image/img_txt_skel/index.parquet +3 -0
- level1/image/img_txt_skel/videos-00000-of-00001.index.parquet +3 -0
- level1/image/img_txt_skel/videos-00000-of-00001.tar +3 -0
- level1/manifests/assets.json +84 -0
- level1/manifests/provenance.json +17 -0
- level1/manifests/validation.json +11 -0
- level1/text/img_txt/data.parquet +3 -0
- level1/text/mul_bal_txt/data.parquet +3 -0
- level1/text/txt_imit/txt_comp_hands/data.parquet +3 -0
- level1/text/txt_imit/txt_comp_legs/data.parquet +3 -0
- level1/text/txt_imit/txt_gen/data.parquet +3 -0
- level1/text/txt_pred/txt_fore/data.parquet +3 -0
- level1/text/txt_pred/txt_inter/data.parquet +3 -0
- level1/text/txt_pred/txt_retro/data.parquet +3 -0
- scripts/build_dataset.py +371 -0
- scripts/restore_text.py +40 -0
CHANGELOG.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
|
| 3 |
+
## v1.0.0 — 2026-09-17
|
| 4 |
+
|
| 5 |
+
Initial Level 1 release: nine processed-text tables, two static-video tasks, original-name recovery, metadata indexes, and SHA-256 verification. No source text rewriting or video re-encoding.
|
README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: RoboSteer Preprocessing
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- robosteer
|
| 7 |
+
- preprocessing
|
| 8 |
+
- motion-generation
|
| 9 |
+
- intermediate-assets
|
| 10 |
+
configs:
|
| 11 |
+
- config_name: level1_txt_gen
|
| 12 |
+
data_files:
|
| 13 |
+
- split: data
|
| 14 |
+
path: level1/text/txt_imit/txt_gen/data.parquet
|
| 15 |
+
- config_name: level1_txt_comp_hands
|
| 16 |
+
data_files:
|
| 17 |
+
- split: data
|
| 18 |
+
path: level1/text/txt_imit/txt_comp_hands/data.parquet
|
| 19 |
+
- config_name: level1_txt_comp_legs
|
| 20 |
+
data_files:
|
| 21 |
+
- split: data
|
| 22 |
+
path: level1/text/txt_imit/txt_comp_legs/data.parquet
|
| 23 |
+
- config_name: level1_txt_fore
|
| 24 |
+
data_files:
|
| 25 |
+
- split: data
|
| 26 |
+
path: level1/text/txt_pred/txt_fore/data.parquet
|
| 27 |
+
- config_name: level1_txt_retro
|
| 28 |
+
data_files:
|
| 29 |
+
- split: data
|
| 30 |
+
path: level1/text/txt_pred/txt_retro/data.parquet
|
| 31 |
+
- config_name: level1_txt_inter
|
| 32 |
+
data_files:
|
| 33 |
+
- split: data
|
| 34 |
+
path: level1/text/txt_pred/txt_inter/data.parquet
|
| 35 |
+
- config_name: level1_img_txt
|
| 36 |
+
data_files:
|
| 37 |
+
- split: data
|
| 38 |
+
path: level1/text/img_txt/data.parquet
|
| 39 |
+
- config_name: level1_mul_bal_txt
|
| 40 |
+
data_files:
|
| 41 |
+
- split: data
|
| 42 |
+
path: level1/text/mul_bal_txt/data.parquet
|
| 43 |
+
- config_name: level1_audio_motion_instructions
|
| 44 |
+
data_files:
|
| 45 |
+
- split: data
|
| 46 |
+
path: level1/audio/motion_instructions/data.parquet
|
| 47 |
+
- config_name: level1_img_txt_human_index
|
| 48 |
+
data_files:
|
| 49 |
+
- split: data
|
| 50 |
+
path: level1/image/img_txt_human/index.parquet
|
| 51 |
+
- config_name: level1_img_txt_skel_index
|
| 52 |
+
data_files:
|
| 53 |
+
- split: data
|
| 54 |
+
path: level1/image/img_txt_skel/index.parquet
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
+
# RoboSteer Preprocessing
|
| 58 |
+
|
| 59 |
+
Reusable intermediate preprocessing assets for RoboSteer. This initial release contains Level 1 processed text instructions and image-conditioned static videos. Other levels and preprocessing stages can be added under their own directories.
|
| 60 |
+
|
| 61 |
+
## Release v1.0.0
|
| 62 |
+
|
| 63 |
+
- **213,044 text records** in nine lossless UTF-8 Parquet tables.
|
| 64 |
+
- **28,666 original MP4 files**: 14,333 IMG_TXT_HUMAN and 14,333 IMG_TXT_SKEL.
|
| 65 |
+
- Independent, uncompressed tar shards contain MP4 files and their normalized JSON metadata.
|
| 66 |
+
- Per-sample indexes, release inventory, SHA-256 checksums, and validation report.
|
| 67 |
+
|
| 68 |
+
These are preprocessing assets, not a declared train/validation/test split. The `data` split means the complete asset collection for a configuration. Audio motion instructions are text derived from audio; audio recordings and raw transcripts are not included. MUL_BAL is included as processed text; this release does not contain MUL_BAL videos. Prediction-video manifests are outside this release scope.
|
| 69 |
+
|
| 70 |
+
## Layout
|
| 71 |
+
|
| 72 |
+
```text
|
| 73 |
+
level1/
|
| 74 |
+
text/txt_imit/{txt_gen,txt_comp_hands,txt_comp_legs}/data.parquet
|
| 75 |
+
text/txt_pred/{txt_fore,txt_retro,txt_inter}/data.parquet
|
| 76 |
+
text/{img_txt,mul_bal_txt}/data.parquet
|
| 77 |
+
audio/motion_instructions/data.parquet
|
| 78 |
+
image/{img_txt_human,img_txt_skel}/
|
| 79 |
+
videos-00000-of-NNNNN.tar
|
| 80 |
+
videos-00000-of-NNNNN.index.parquet
|
| 81 |
+
index.parquet
|
| 82 |
+
manifests/{assets,validation,provenance}.json
|
| 83 |
+
scripts/restore_text.py
|
| 84 |
+
scripts/build_dataset.py
|
| 85 |
+
SHA256SUMS
|
| 86 |
+
CHANGELOG.md
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Load text or an index
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
from datasets import load_dataset
|
| 93 |
+
ds = load_dataset("PhoebeCC/RoboSteer-Preprocessing", "level1_txt_gen", split="data", revision="v1.0.0")
|
| 94 |
+
video_index = load_dataset("PhoebeCC/RoboSteer-Preprocessing", "level1_img_txt_human_index", split="data", revision="v1.0.0")
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
Text columns: `sample_id`, `source_sample_id`, `task`, `level`, `source_modality`, `text`, `original_relpath`, `size_bytes`, `sha256`. Original UTF-8 bytes, including line endings, can be reconstructed with `text.encode('utf-8')`. Use `scripts/restore_text.py` to restore the original relative file layout.
|
| 98 |
+
|
| 99 |
+
## Download video shards
|
| 100 |
+
|
| 101 |
+
```python
|
| 102 |
+
from huggingface_hub import snapshot_download
|
| 103 |
+
snapshot_download("PhoebeCC/RoboSteer-Preprocessing", repo_type="dataset",
|
| 104 |
+
revision="v1.0.0", local_dir="robosteer-preprocessing",
|
| 105 |
+
allow_patterns=["level1/image/img_txt_human/*", "level1/manifests/*", "README.md", "SHA256SUMS"])
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Each tar is independently extractable. The index identifies its repository-relative `shard`, MP4 `member_path`, JSON `metadata_member_path`, and checksums. Video indexes are searchable tables; this release does not configure an embedded-video viewer. Extract each task into a separate folder. MP4 files are preserved byte for byte, without re-encoding.
|
| 109 |
+
|
| 110 |
+
## Provenance and alignment
|
| 111 |
+
|
| 112 |
+
`sample_id` preserves the source filename stem. `source_sample_id` removes only the known task prefix (or audio suffix). Use `(task, sample_id)` as an asset key; use `source_sample_id` to join related tasks, without assuming all tasks cover the same samples. Coverage results are recorded in the validation report.
|
| 113 |
+
|
| 114 |
+
Video metadata originates from existing sidecar JSON files. Metadata text is the original sidecar description, not necessarily the rewritten `text/img_txt` instruction. Image paths are converted to paths relative to the external public-data root. Source duration and generated duration are metadata values, not newly measured properties. The source generator specifies 25 FPS; this packaging run does not probe actual MP4 frame rates. Source images, external task JSONs, model weights, raw audio, audit logs, and organization backups are not bundled.
|
| 115 |
+
|
| 116 |
+
## Rights and citation
|
| 117 |
+
|
| 118 |
+
The repository owner has not yet supplied a release license or complete upstream attribution. No blanket open-source license is asserted for these derived assets. Upstream restrictions remain applicable; consult the owner about permitted redistribution and use. Formal benchmark citation and upstream dataset attribution will be added when supplied.
|
| 119 |
+
|
| 120 |
+
## Reproducibility
|
| 121 |
+
|
| 122 |
+
See `level1/manifests/provenance.json` for packaging rules and generator fingerprints, `assets.json` for counts, and `validation.json` for checks. `SHA256SUMS` covers all payload and documentation files except itself. SHA-256 verification can be performed with `sha256sum -c SHA256SUMS` after a full download. Release tags identify immutable intended snapshots; pin the tag or commit for experiments. Later assets should extend task-specific paths and receive a new version and changelog entry.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
72da23bf0d02b4c74bdb144ff1e2dc808a406a8f95a509910c4bd8d41c1045aa CHANGELOG.md
|
| 2 |
+
ae579a4341144a2a2e4d8d629df796e113a877e077eca049383c170a70d9a0e1 README.md
|
| 3 |
+
8e8ffccb15a01db37b5e5db7c9bfbdc6189b54350580924b1e97865225c8effd level1/README.md
|
| 4 |
+
bfef43e1dc61d0bdd984300809a648b5a867dd91d88752f335ed25bea8b90cd7 level1/audio/motion_instructions/data.parquet
|
| 5 |
+
5df4702911e2e99ec798e440fd40a01d2e08260fd01a9ce9a5c83b7f279d3e1f level1/image/img_txt_human/index.parquet
|
| 6 |
+
57bf240f287542fcd6f791d28f247a0b4792e39fb195a5aedfbf8e15f11dee34 level1/image/img_txt_human/videos-00000-of-00005.index.parquet
|
| 7 |
+
6dc5bc4ff83d2af9399f69ab690a52739b835f1b9f53bb1f17f8d8512fb0bd75 level1/image/img_txt_human/videos-00000-of-00005.tar
|
| 8 |
+
dd9e97780d72808c5b3c3f85fdd9cff9773ba57d24fab0a7ea9ceb7c6d98335b level1/image/img_txt_human/videos-00001-of-00005.index.parquet
|
| 9 |
+
1cb2c9e291fcd28658ad976a6897d4bd9555ad7578bb48aac6bcefb38bc0535e level1/image/img_txt_human/videos-00001-of-00005.tar
|
| 10 |
+
2e782fbaa534c9e1069523f40ceaaa63bc7e3493784e7c772fc93164b62cb976 level1/image/img_txt_human/videos-00002-of-00005.index.parquet
|
| 11 |
+
de33cb6e65c0491b6d172ce855c10552c9984bb7832bdeef91d340ddfdf38cf8 level1/image/img_txt_human/videos-00002-of-00005.tar
|
| 12 |
+
6cef1a5344b7072266b48fc66a067ac516184a5d6b88ad6542ef039611d495db level1/image/img_txt_human/videos-00003-of-00005.index.parquet
|
| 13 |
+
fdda7d190a419e82335e2d22d08fe55c498be2310e951ee3e3d378ac2f0a6c01 level1/image/img_txt_human/videos-00003-of-00005.tar
|
| 14 |
+
c7e0b8a83d8369b17068974765a9f4cb4ca7519cd876100eee7f4d121dd490c9 level1/image/img_txt_human/videos-00004-of-00005.index.parquet
|
| 15 |
+
ae144351bb309ad0e73d97b488ee50da6e79cf5aab99474da665ba163f204eb4 level1/image/img_txt_human/videos-00004-of-00005.tar
|
| 16 |
+
201017542e301ebb04056ec8373e7f6cdef5a1f07a3bb420b313432c14525d8f level1/image/img_txt_skel/index.parquet
|
| 17 |
+
201017542e301ebb04056ec8373e7f6cdef5a1f07a3bb420b313432c14525d8f level1/image/img_txt_skel/videos-00000-of-00001.index.parquet
|
| 18 |
+
1dfa5fadb895061f3a3581db68e50b7ac9890de43343e89e3e183098e8977849 level1/image/img_txt_skel/videos-00000-of-00001.tar
|
| 19 |
+
ee5b35f9815831d734933dd35978069203d629269d3b9f5db4a80415d374d83e level1/manifests/assets.json
|
| 20 |
+
25336b3f568fa1c8e7aa4f8915193ea52b0e385e37be7e3f2f2d6fb811301456 level1/manifests/provenance.json
|
| 21 |
+
68729ecef845bc4128b1a4eea711c69dea604f6dff39af7e93749034e712dede level1/manifests/validation.json
|
| 22 |
+
3fe0a5bf1a6864425a1dc67c9428c1c4a583b68ef8cb26a83538ded8ae082754 level1/text/img_txt/data.parquet
|
| 23 |
+
cecc1813667fc4924a462818985f29c9f976448ddad071b1b4a557d3e037ae37 level1/text/mul_bal_txt/data.parquet
|
| 24 |
+
ca153ad67cd61685623a89d6a32e68cfb0fccec0e0a9a45c9c970880016ae936 level1/text/txt_imit/txt_comp_hands/data.parquet
|
| 25 |
+
67f54b5974dce81d59237b2056c6ac3439375be13ef9277d4c501abf29a8597e level1/text/txt_imit/txt_comp_legs/data.parquet
|
| 26 |
+
b78ce4e03cd89487588edd03626554269c1d2fbd8199f268475ab5bc503fa27a level1/text/txt_imit/txt_gen/data.parquet
|
| 27 |
+
0ff3312de5dec97154d2cbf0841b34bf665b6a7c95d128d0dcf039301f415d28 level1/text/txt_pred/txt_fore/data.parquet
|
| 28 |
+
bfcb12d7609406aeb55ccecb0b79762c9d228478069a6dde15cd7779049031b7 level1/text/txt_pred/txt_inter/data.parquet
|
| 29 |
+
4b3085f251d45b94a1eed51760393477b74b81964d168546020f546c2f1606d7 level1/text/txt_pred/txt_retro/data.parquet
|
| 30 |
+
f831c77f531e6bc3f3144ae7a77f22804e313853a9647c1d214c474674d777ef scripts/build_dataset.py
|
| 31 |
+
5be165f88269e4fecc76a8a76bedc1b423488704897c4afb656eae8c766845c3 scripts/restore_text.py
|
level1/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Level 1 预处理中间资产
|
| 2 |
+
|
| 3 |
+
本发布目录独立于工作目录,包含本次选定的整理后文本和 IMG_TXT 条件视频。
|
| 4 |
+
|
| 5 |
+
| 文本配置 | 条数 | 仓库路径 |
|
| 6 |
+
|---|---:|---|
|
| 7 |
+
| level1_txt_gen | 38,522 | `level1/text/txt_imit/txt_gen/data.parquet` |
|
| 8 |
+
| level1_txt_comp_hands | 38,522 | `level1/text/txt_imit/txt_comp_hands/data.parquet` |
|
| 9 |
+
| level1_txt_comp_legs | 38,522 | `level1/text/txt_imit/txt_comp_legs/data.parquet` |
|
| 10 |
+
| level1_txt_fore | 14,333 | `level1/text/txt_pred/txt_fore/data.parquet` |
|
| 11 |
+
| level1_txt_retro | 14,333 | `level1/text/txt_pred/txt_retro/data.parquet` |
|
| 12 |
+
| level1_txt_inter | 7,764 | `level1/text/txt_pred/txt_inter/data.parquet` |
|
| 13 |
+
| level1_img_txt | 14,333 | `level1/text/img_txt/data.parquet` |
|
| 14 |
+
| level1_mul_bal_txt | 8,193 | `level1/text/mul_bal_txt/data.parquet` |
|
| 15 |
+
| level1_audio_motion_instructions | 38,522 | `level1/audio/motion_instructions/data.parquet` |
|
| 16 |
+
|
| 17 |
+
HUMAN 与 SKEL 各 14,333 个 MP4,保存在 image/ 下独立 tar 分片中;index.parquet 可定位每个视频及 JSON 元数据。已有 JSON 中的服务器绝对图片路径已改为相对于外部 public 根的路径。
|
| 18 |
+
|
| 19 |
+
音频类仅包含整理后的动作指令;本发布不含音频实体或转写全文。MUL_BAL 目前仅包含文本。各配置的 data 表示完整资产集合,不代表训练集划分。
|
| 20 |
+
|
| 21 |
+
详见仓库根 README、manifests/ 清单和 SHA256SUMS。
|
level1/audio/motion_instructions/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfef43e1dc61d0bdd984300809a648b5a867dd91d88752f335ed25bea8b90cd7
|
| 3 |
+
size 6600405
|
level1/image/img_txt_human/index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5df4702911e2e99ec798e440fd40a01d2e08260fd01a9ce9a5c83b7f279d3e1f
|
| 3 |
+
size 3278467
|
level1/image/img_txt_human/videos-00000-of-00005.index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57bf240f287542fcd6f791d28f247a0b4792e39fb195a5aedfbf8e15f11dee34
|
| 3 |
+
size 704524
|
level1/image/img_txt_human/videos-00000-of-00005.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6dc5bc4ff83d2af9399f69ab690a52739b835f1b9f53bb1f17f8d8512fb0bd75
|
| 3 |
+
size 1053890560
|
level1/image/img_txt_human/videos-00001-of-00005.index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd9e97780d72808c5b3c3f85fdd9cff9773ba57d24fab0a7ea9ceb7c6d98335b
|
| 3 |
+
size 700675
|
level1/image/img_txt_human/videos-00001-of-00005.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1cb2c9e291fcd28658ad976a6897d4bd9555ad7578bb48aac6bcefb38bc0535e
|
| 3 |
+
size 1054064640
|
level1/image/img_txt_human/videos-00002-of-00005.index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e782fbaa534c9e1069523f40ceaaa63bc7e3493784e7c772fc93164b62cb976
|
| 3 |
+
size 708865
|
level1/image/img_txt_human/videos-00002-of-00005.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de33cb6e65c0491b6d172ce855c10552c9984bb7832bdeef91d340ddfdf38cf8
|
| 3 |
+
size 1053849600
|
level1/image/img_txt_human/videos-00003-of-00005.index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6cef1a5344b7072266b48fc66a067ac516184a5d6b88ad6542ef039611d495db
|
| 3 |
+
size 676290
|
level1/image/img_txt_human/videos-00003-of-00005.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fdda7d190a419e82335e2d22d08fe55c498be2310e951ee3e3d378ac2f0a6c01
|
| 3 |
+
size 1054638080
|
level1/image/img_txt_human/videos-00004-of-00005.index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c7e0b8a83d8369b17068974765a9f4cb4ca7519cd876100eee7f4d121dd490c9
|
| 3 |
+
size 506480
|
level1/image/img_txt_human/videos-00004-of-00005.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae144351bb309ad0e73d97b488ee50da6e79cf5aab99474da665ba163f204eb4
|
| 3 |
+
size 743598080
|
level1/image/img_txt_skel/index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:201017542e301ebb04056ec8373e7f6cdef5a1f07a3bb420b313432c14525d8f
|
| 3 |
+
size 3252270
|
level1/image/img_txt_skel/videos-00000-of-00001.index.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:201017542e301ebb04056ec8373e7f6cdef5a1f07a3bb420b313432c14525d8f
|
| 3 |
+
size 3252270
|
level1/image/img_txt_skel/videos-00000-of-00001.tar
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1dfa5fadb895061f3a3581db68e50b7ac9890de43343e89e3e183098e8977849
|
| 3 |
+
size 308602880
|
level1/manifests/assets.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": "v1.0.0",
|
| 3 |
+
"text": [
|
| 4 |
+
{
|
| 5 |
+
"config": "level1_txt_gen",
|
| 6 |
+
"task": "TXT_GEN",
|
| 7 |
+
"path": "level1/text/txt_imit/txt_gen/data.parquet",
|
| 8 |
+
"records": 38522,
|
| 9 |
+
"empty_text_records": 0
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"config": "level1_txt_comp_hands",
|
| 13 |
+
"task": "TXT_COMP_HANDS",
|
| 14 |
+
"path": "level1/text/txt_imit/txt_comp_hands/data.parquet",
|
| 15 |
+
"records": 38522,
|
| 16 |
+
"empty_text_records": 0
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"config": "level1_txt_comp_legs",
|
| 20 |
+
"task": "TXT_COMP_LEGS",
|
| 21 |
+
"path": "level1/text/txt_imit/txt_comp_legs/data.parquet",
|
| 22 |
+
"records": 38522,
|
| 23 |
+
"empty_text_records": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"config": "level1_txt_fore",
|
| 27 |
+
"task": "TXT_FORE",
|
| 28 |
+
"path": "level1/text/txt_pred/txt_fore/data.parquet",
|
| 29 |
+
"records": 14333,
|
| 30 |
+
"empty_text_records": 0
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"config": "level1_txt_retro",
|
| 34 |
+
"task": "TXT_RETRO",
|
| 35 |
+
"path": "level1/text/txt_pred/txt_retro/data.parquet",
|
| 36 |
+
"records": 14333,
|
| 37 |
+
"empty_text_records": 0
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"config": "level1_txt_inter",
|
| 41 |
+
"task": "TXT_INTER",
|
| 42 |
+
"path": "level1/text/txt_pred/txt_inter/data.parquet",
|
| 43 |
+
"records": 7764,
|
| 44 |
+
"empty_text_records": 0
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"config": "level1_img_txt",
|
| 48 |
+
"task": "IMG_TXT_SKEL",
|
| 49 |
+
"path": "level1/text/img_txt/data.parquet",
|
| 50 |
+
"records": 14333,
|
| 51 |
+
"empty_text_records": 0
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"config": "level1_mul_bal_txt",
|
| 55 |
+
"task": "MUL_BAL",
|
| 56 |
+
"path": "level1/text/mul_bal_txt/data.parquet",
|
| 57 |
+
"records": 8193,
|
| 58 |
+
"empty_text_records": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"config": "level1_audio_motion_instructions",
|
| 62 |
+
"task": "AUDIO_MOTION_INSTRUCTIONS",
|
| 63 |
+
"path": "level1/audio/motion_instructions/data.parquet",
|
| 64 |
+
"records": 38522,
|
| 65 |
+
"empty_text_records": 0
|
| 66 |
+
}
|
| 67 |
+
],
|
| 68 |
+
"videos": [
|
| 69 |
+
{
|
| 70 |
+
"task": "IMG_TXT_HUMAN",
|
| 71 |
+
"path": "level1/image/img_txt_human",
|
| 72 |
+
"records": 14333,
|
| 73 |
+
"shards": 5,
|
| 74 |
+
"source_mp4_bytes": 4930718649
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"task": "IMG_TXT_SKEL",
|
| 78 |
+
"path": "level1/image/img_txt_skel",
|
| 79 |
+
"records": 14333,
|
| 80 |
+
"shards": 1,
|
| 81 |
+
"source_mp4_bytes": 279026980
|
| 82 |
+
}
|
| 83 |
+
]
|
| 84 |
+
}
|
level1/manifests/provenance.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"release": "v1.0.0",
|
| 3 |
+
"packaged_date": "2026-09-17",
|
| 4 |
+
"packaging_script_sha256": "f831c77f531e6bc3f3144ae7a77f22804e313853a9647c1d214c474674d777ef",
|
| 5 |
+
"pyarrow_version": "24.0.0",
|
| 6 |
+
"text_policy": "strict UTF-8; bytes and line endings preserved",
|
| 7 |
+
"mp4_policy": "unmodified source bytes",
|
| 8 |
+
"metadata_policy": "external image paths normalized to public-root-relative",
|
| 9 |
+
"shard_target_bytes": 1073741824,
|
| 10 |
+
"tar_policy": "independent PAX tar, sorted filenames, normalized headers",
|
| 11 |
+
"source_generator_fingerprints": {
|
| 12 |
+
"build_keyframe_static_videos.py": "8a74e03bfd4b4481f37241e4aac21eafd12e75470fb73917071330e85f469a2a",
|
| 13 |
+
"run_img_txt_video_to_motion_fast.sh": "9b5a39932dc5314f2d24a660223a15501c6c9575834758d0bce23c5bb58110f2"
|
| 14 |
+
},
|
| 15 |
+
"source_generation_commit": null,
|
| 16 |
+
"source_generation_commit_note": "Historical generation commit was not recorded"
|
| 17 |
+
}
|
level1/manifests/validation.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"text_records": 213044,
|
| 3 |
+
"video_records": 28666,
|
| 4 |
+
"text_utf8_roundtrip_sha256": "passed for every row",
|
| 5 |
+
"video_and_metadata_tar_payload_sha256": "passed for every member",
|
| 6 |
+
"duplicate_asset_ids": 0,
|
| 7 |
+
"human_skel_matching_source_ids": 14333,
|
| 8 |
+
"img_text_skel_matching_source_ids": 14333,
|
| 9 |
+
"empty_text_records": 0,
|
| 10 |
+
"mp4_decoding_test": "not performed; lossless packaging only"
|
| 11 |
+
}
|
level1/text/img_txt/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3fe0a5bf1a6864425a1dc67c9428c1c4a583b68ef8cb26a83538ded8ae082754
|
| 3 |
+
size 1183629
|
level1/text/mul_bal_txt/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cecc1813667fc4924a462818985f29c9f976448ddad071b1b4a557d3e037ae37
|
| 3 |
+
size 855141
|
level1/text/txt_imit/txt_comp_hands/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca153ad67cd61685623a89d6a32e68cfb0fccec0e0a9a45c9c970880016ae936
|
| 3 |
+
size 5063421
|
level1/text/txt_imit/txt_comp_legs/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:67f54b5974dce81d59237b2056c6ac3439375be13ef9277d4c501abf29a8597e
|
| 3 |
+
size 5509060
|
level1/text/txt_imit/txt_gen/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b78ce4e03cd89487588edd03626554269c1d2fbd8199f268475ab5bc503fa27a
|
| 3 |
+
size 6558848
|
level1/text/txt_pred/txt_fore/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ff3312de5dec97154d2cbf0841b34bf665b6a7c95d128d0dcf039301f415d28
|
| 3 |
+
size 2090675
|
level1/text/txt_pred/txt_inter/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfcb12d7609406aeb55ccecb0b79762c9d228478069a6dde15cd7779049031b7
|
| 3 |
+
size 1155631
|
level1/text/txt_pred/txt_retro/data.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b3085f251d45b94a1eed51760393477b74b81964d168546020f546c2f1606d7
|
| 3 |
+
size 2072849
|
scripts/build_dataset.py
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Build the RoboSteer Level 1 publication tree without modifying source assets."""
|
| 3 |
+
import argparse
|
| 4 |
+
import concurrent.futures
|
| 5 |
+
import hashlib
|
| 6 |
+
import io
|
| 7 |
+
import json
|
| 8 |
+
import os
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
import shutil
|
| 11 |
+
import tarfile
|
| 12 |
+
import time
|
| 13 |
+
|
| 14 |
+
import pyarrow as pa
|
| 15 |
+
import pyarrow.parquet as pq
|
| 16 |
+
|
| 17 |
+
VERSION = "v1.0.0"
|
| 18 |
+
TEXT = [
|
| 19 |
+
("txt_gen", "text/processed/TXT/IMIT/TXT_GEN", "text/txt_imit/txt_gen", "TXT_GEN", 38522),
|
| 20 |
+
("txt_comp_hands", "text/processed/TXT/IMIT/TXT_COMP_HANDS", "text/txt_imit/txt_comp_hands", "TXT_COMP_HANDS", 38522),
|
| 21 |
+
("txt_comp_legs", "text/processed/TXT/IMIT/TXT_COMP_LEGS", "text/txt_imit/txt_comp_legs", "TXT_COMP_LEGS", 38522),
|
| 22 |
+
("txt_fore", "text/processed/TXT/PRED/TXT_FORE", "text/txt_pred/txt_fore", "TXT_FORE", 14333),
|
| 23 |
+
("txt_retro", "text/processed/TXT/PRED/TXT_RETRO", "text/txt_pred/txt_retro", "TXT_RETRO", 14333),
|
| 24 |
+
("txt_inter", "text/processed/TXT/PRED/TXT_INTER", "text/txt_pred/txt_inter", "TXT_INTER", 7764),
|
| 25 |
+
("img_txt", "text/processed/IMG_TXT", "text/img_txt", "IMG_TXT_SKEL", 14333),
|
| 26 |
+
("mul_bal_txt", "text/processed/MUL_BAL_TXT", "text/mul_bal_txt", "MUL_BAL", 8193),
|
| 27 |
+
("audio_motion_instructions", "audio/processed/whisper_txt_preprocessed", "audio/motion_instructions", "AUDIO_MOTION_INSTRUCTIONS", 38522),
|
| 28 |
+
]
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def log(*args):
|
| 32 |
+
print(time.strftime("%Y-%m-%d %H:%M:%S"), *args, flush=True)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def digest(path):
|
| 36 |
+
h = hashlib.sha256()
|
| 37 |
+
with open(path, "rb") as f:
|
| 38 |
+
for block in iter(lambda: f.read(4 * 1024 * 1024), b""):
|
| 39 |
+
h.update(block)
|
| 40 |
+
return h.hexdigest()
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def write_json(path, value):
|
| 44 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 45 |
+
path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def write_parquet(path, rows):
|
| 49 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 50 |
+
tmp = path.with_suffix(".parquet.tmp")
|
| 51 |
+
pq.write_table(pa.Table.from_pylist(rows), tmp, compression="zstd", row_group_size=10000)
|
| 52 |
+
tmp.replace(path)
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def source_id(stem, task):
|
| 56 |
+
prefix = "L1_" + task + "_"
|
| 57 |
+
if stem.startswith(prefix):
|
| 58 |
+
return stem[len(prefix):]
|
| 59 |
+
if task == "AUDIO_MOTION_INSTRUCTIONS" and stem.endswith("_audio"):
|
| 60 |
+
return stem[:-len("_audio")]
|
| 61 |
+
raise ValueError(f"Unrecognized sample naming: {task}: {stem}")
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def read_unchanged(path):
|
| 65 |
+
before = path.stat()
|
| 66 |
+
data = path.read_bytes()
|
| 67 |
+
after = path.stat()
|
| 68 |
+
assert (before.st_size, before.st_mtime_ns) == (after.st_size, after.st_mtime_ns), path
|
| 69 |
+
return data
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def build_text(source, release):
|
| 73 |
+
manifest = []
|
| 74 |
+
ids = {}
|
| 75 |
+
for config, src, dst, task, expected in TEXT:
|
| 76 |
+
files = sorted((source / src).rglob("*.txt"))
|
| 77 |
+
assert len(files) == expected, (src, len(files), expected)
|
| 78 |
+
|
| 79 |
+
def convert(path):
|
| 80 |
+
assert not path.is_symlink(), path
|
| 81 |
+
data = read_unchanged(path)
|
| 82 |
+
return {
|
| 83 |
+
"sample_id": path.stem,
|
| 84 |
+
"source_sample_id": source_id(path.stem, task),
|
| 85 |
+
"task": task,
|
| 86 |
+
"level": "level1",
|
| 87 |
+
"source_modality": "audio" if config.startswith("audio_") else "text",
|
| 88 |
+
"text": data.decode("utf-8"),
|
| 89 |
+
"original_relpath": str(path.relative_to(source)),
|
| 90 |
+
"size_bytes": len(data),
|
| 91 |
+
"sha256": hashlib.sha256(data).hexdigest(),
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
with concurrent.futures.ThreadPoolExecutor(max_workers=12) as pool:
|
| 95 |
+
rows = list(pool.map(convert, files))
|
| 96 |
+
assert len({x["sample_id"] for x in rows}) == expected
|
| 97 |
+
dest = release / "level1" / dst / "data.parquet"
|
| 98 |
+
write_parquet(dest, rows)
|
| 99 |
+
restored = pq.read_table(dest).to_pylist()
|
| 100 |
+
assert len(restored) == expected
|
| 101 |
+
for row in restored:
|
| 102 |
+
raw = row["text"].encode("utf-8")
|
| 103 |
+
assert len(raw) == row["size_bytes"]
|
| 104 |
+
assert hashlib.sha256(raw).hexdigest() == row["sha256"]
|
| 105 |
+
ids[config] = {x["source_sample_id"] for x in rows}
|
| 106 |
+
manifest.append({"config": "level1_" + config, "task": task,
|
| 107 |
+
"path": str(dest.relative_to(release)), "records": expected,
|
| 108 |
+
"empty_text_records": sum(not x["text"].strip() for x in rows)})
|
| 109 |
+
log("TEXT_VERIFIED", config, expected)
|
| 110 |
+
return manifest, ids
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
class HashReader:
|
| 114 |
+
def __init__(self, f):
|
| 115 |
+
self.f = f
|
| 116 |
+
self.hash = hashlib.sha256()
|
| 117 |
+
|
| 118 |
+
def read(self, n=-1):
|
| 119 |
+
data = self.f.read(n)
|
| 120 |
+
self.hash.update(data)
|
| 121 |
+
return data
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def public_relative(value):
|
| 125 |
+
if "/public/" in value:
|
| 126 |
+
value = value.split("/public/", 1)[1]
|
| 127 |
+
p = Path(value)
|
| 128 |
+
if p.is_absolute() or ".." in p.parts:
|
| 129 |
+
raise ValueError("Image provenance must be relative to public root")
|
| 130 |
+
return p.as_posix()
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
def tar_info(name, size):
|
| 134 |
+
entry = tarfile.TarInfo(name)
|
| 135 |
+
entry.size = size
|
| 136 |
+
entry.mode = 0o644
|
| 137 |
+
entry.uid = entry.gid = entry.mtime = 0
|
| 138 |
+
return entry
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def build_video(source, release, task, target_bytes):
|
| 142 |
+
folder = release / "level1/image" / task.lower()
|
| 143 |
+
folder.mkdir(parents=True, exist_ok=True)
|
| 144 |
+
source_dir = source / "img+mul_bal/output" / task
|
| 145 |
+
metadata_dir = source / "img+mul_bal/inputs/keyframe_static_videos" / task
|
| 146 |
+
videos = sorted(source_dir.glob("*.mp4"))
|
| 147 |
+
assert len(videos) == 14333
|
| 148 |
+
assert {p.stem for p in videos} == {p.stem for p in metadata_dir.glob("*.json")}
|
| 149 |
+
groups, group, size = [], [], 0
|
| 150 |
+
for p in videos:
|
| 151 |
+
estimate = ((p.stat().st_size + 511) // 512) * 512 + 8192
|
| 152 |
+
if group and size + estimate > target_bytes:
|
| 153 |
+
groups.append(group)
|
| 154 |
+
group, size = [], 0
|
| 155 |
+
group.append(p)
|
| 156 |
+
size += estimate
|
| 157 |
+
if group:
|
| 158 |
+
groups.append(group)
|
| 159 |
+
all_rows = []
|
| 160 |
+
for i, members in enumerate(groups):
|
| 161 |
+
shard = folder / f"videos-{i:05d}-of-{len(groups):05d}.tar"
|
| 162 |
+
checkpoint = shard.with_suffix(".index.parquet")
|
| 163 |
+
if shard.exists() and checkpoint.exists():
|
| 164 |
+
rows = pq.read_table(checkpoint).to_pylist()
|
| 165 |
+
assert [x["sample_id"] for x in rows] == [p.stem for p in members]
|
| 166 |
+
all_rows.extend(rows)
|
| 167 |
+
log("REUSE_SHARD", shard.name)
|
| 168 |
+
continue
|
| 169 |
+
rows = []
|
| 170 |
+
temp = shard.with_suffix(".tar.tmp")
|
| 171 |
+
with tarfile.open(temp, "w", format=tarfile.PAX_FORMAT) as tar:
|
| 172 |
+
for p in members:
|
| 173 |
+
assert not p.is_symlink()
|
| 174 |
+
before = p.stat()
|
| 175 |
+
meta_path = metadata_dir / (p.stem + ".json")
|
| 176 |
+
raw_meta = read_unchanged(meta_path)
|
| 177 |
+
meta = json.loads(raw_meta)
|
| 178 |
+
assert meta["task_id"] == p.stem
|
| 179 |
+
meta["input_images"] = [public_relative(x) for x in meta["input_images"]]
|
| 180 |
+
meta["input_images_base"] = "external_public_root"
|
| 181 |
+
normalized = (json.dumps(meta, ensure_ascii=False, indent=2) + "\n").encode("utf-8")
|
| 182 |
+
with p.open("rb") as f:
|
| 183 |
+
reader = HashReader(f)
|
| 184 |
+
tar.addfile(tar_info(p.name, before.st_size), reader)
|
| 185 |
+
after = p.stat()
|
| 186 |
+
assert (before.st_size, before.st_mtime_ns) == (after.st_size, after.st_mtime_ns)
|
| 187 |
+
tar.addfile(tar_info(p.stem + ".json", len(normalized)), io.BytesIO(normalized))
|
| 188 |
+
rows.append({
|
| 189 |
+
"sample_id": p.stem, "source_sample_id": source_id(p.stem, task),
|
| 190 |
+
"task": task, "level": "level1", "source_modality": "image",
|
| 191 |
+
"shard": str(shard.relative_to(release)), "member_path": p.name,
|
| 192 |
+
"metadata_member_path": p.stem + ".json",
|
| 193 |
+
"original_relpath": str(p.relative_to(source)),
|
| 194 |
+
"size_bytes": before.st_size, "sha256": reader.hash.hexdigest(),
|
| 195 |
+
"metadata_sha256": hashlib.sha256(normalized).hexdigest(),
|
| 196 |
+
"source_metadata_sha256": hashlib.sha256(raw_meta).hexdigest(),
|
| 197 |
+
"text": meta["text"],
|
| 198 |
+
"source_duration_seconds": float(meta["source_duration_seconds"]),
|
| 199 |
+
"generated_duration_seconds": float(meta["generated_duration_seconds"]),
|
| 200 |
+
"timestamps_seconds": meta["timestamps_seconds"],
|
| 201 |
+
"static_frame_durations_seconds": meta["static_frame_durations_seconds"],
|
| 202 |
+
"input_images": meta["input_images"],
|
| 203 |
+
})
|
| 204 |
+
temp.replace(shard)
|
| 205 |
+
write_parquet(checkpoint, rows)
|
| 206 |
+
all_rows.extend(rows)
|
| 207 |
+
log("SHARD_WRITTEN", task, shard.name, len(rows), shard.stat().st_size)
|
| 208 |
+
assert len(all_rows) == 14333
|
| 209 |
+
assert len({x["sample_id"] for x in all_rows}) == 14333
|
| 210 |
+
write_parquet(folder / "index.parquet", all_rows)
|
| 211 |
+
# Read all tar payloads back, checking hashes and exact archive membership.
|
| 212 |
+
for shard in sorted(folder.glob("*.tar")):
|
| 213 |
+
wanted = {}
|
| 214 |
+
for row in all_rows:
|
| 215 |
+
if row["shard"] == str(shard.relative_to(release)):
|
| 216 |
+
wanted[row["member_path"]] = row["sha256"]
|
| 217 |
+
wanted[row["metadata_member_path"]] = row["metadata_sha256"]
|
| 218 |
+
seen = set()
|
| 219 |
+
with tarfile.open(shard, "r|") as tar:
|
| 220 |
+
for entry in tar:
|
| 221 |
+
assert entry.isfile() and entry.name in wanted and entry.name not in seen
|
| 222 |
+
f = tar.extractfile(entry)
|
| 223 |
+
h = hashlib.sha256()
|
| 224 |
+
for block in iter(lambda: f.read(1024 * 1024), b""):
|
| 225 |
+
h.update(block)
|
| 226 |
+
assert h.hexdigest() == wanted[entry.name]
|
| 227 |
+
seen.add(entry.name)
|
| 228 |
+
assert seen == set(wanted)
|
| 229 |
+
log("SHARD_VERIFIED", task, shard.name)
|
| 230 |
+
# Per-shard indexes are kept: they support selective download and resumable builds.
|
| 231 |
+
return {"task": task, "path": str(folder.relative_to(release)), "records": len(all_rows),
|
| 232 |
+
"shards": len(groups), "source_mp4_bytes": sum(x["size_bytes"] for x in all_rows)}, {
|
| 233 |
+
x["source_sample_id"] for x in all_rows}
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
def build_docs(release, texts, videos, validation):
|
| 237 |
+
config = []
|
| 238 |
+
for row in texts:
|
| 239 |
+
config += [f"- config_name: {row['config']}", " data_files:", " - split: data",
|
| 240 |
+
f" path: {row['path']}"]
|
| 241 |
+
for row in videos:
|
| 242 |
+
config += [f"- config_name: level1_{row['task'].lower()}_index", " data_files:",
|
| 243 |
+
" - split: data", f" path: {row['path']}/index.parquet"]
|
| 244 |
+
readme = "---\npretty_name: RoboSteer Preprocessing\nlanguage:\n- en\ntags:\n- robosteer\n- preprocessing\n- motion-generation\n- intermediate-assets\nconfigs:\n" + "\n".join(config) + "\n---\n\n"
|
| 245 |
+
readme += """# RoboSteer Preprocessing
|
| 246 |
+
|
| 247 |
+
Reusable intermediate preprocessing assets for RoboSteer. This initial release contains Level 1 processed text instructions and image-conditioned static videos. Other levels and preprocessing stages can be added under their own directories.
|
| 248 |
+
|
| 249 |
+
## Release v1.0.0
|
| 250 |
+
|
| 251 |
+
- **213,044 text records** in nine lossless UTF-8 Parquet tables.
|
| 252 |
+
- **28,666 original MP4 files**: 14,333 IMG_TXT_HUMAN and 14,333 IMG_TXT_SKEL.
|
| 253 |
+
- Independent, uncompressed tar shards contain MP4 files and their normalized JSON metadata.
|
| 254 |
+
- Per-sample indexes, release inventory, SHA-256 checksums, and validation report.
|
| 255 |
+
|
| 256 |
+
These are preprocessing assets, not a declared train/validation/test split. The `data` split means the complete asset collection for a configuration. Audio motion instructions are text derived from audio; audio recordings and raw transcripts are not included. MUL_BAL is included as processed text; this release does not contain MUL_BAL videos. Prediction-video manifests are outside this release scope.
|
| 257 |
+
|
| 258 |
+
## Layout
|
| 259 |
+
|
| 260 |
+
```text
|
| 261 |
+
level1/
|
| 262 |
+
text/txt_imit/{txt_gen,txt_comp_hands,txt_comp_legs}/data.parquet
|
| 263 |
+
text/txt_pred/{txt_fore,txt_retro,txt_inter}/data.parquet
|
| 264 |
+
text/{img_txt,mul_bal_txt}/data.parquet
|
| 265 |
+
audio/motion_instructions/data.parquet
|
| 266 |
+
image/{img_txt_human,img_txt_skel}/
|
| 267 |
+
videos-00000-of-NNNNN.tar
|
| 268 |
+
videos-00000-of-NNNNN.index.parquet
|
| 269 |
+
index.parquet
|
| 270 |
+
manifests/{assets,validation,provenance}.json
|
| 271 |
+
scripts/restore_text.py
|
| 272 |
+
scripts/build_dataset.py
|
| 273 |
+
SHA256SUMS
|
| 274 |
+
CHANGELOG.md
|
| 275 |
+
```
|
| 276 |
+
|
| 277 |
+
## Load text or an index
|
| 278 |
+
|
| 279 |
+
```python
|
| 280 |
+
from datasets import load_dataset
|
| 281 |
+
ds = load_dataset("PhoebeCC/RoboSteer-Preprocessing", "level1_txt_gen", split="data", revision="v1.0.0")
|
| 282 |
+
video_index = load_dataset("PhoebeCC/RoboSteer-Preprocessing", "level1_img_txt_human_index", split="data", revision="v1.0.0")
|
| 283 |
+
```
|
| 284 |
+
|
| 285 |
+
Text columns: `sample_id`, `source_sample_id`, `task`, `level`, `source_modality`, `text`, `original_relpath`, `size_bytes`, `sha256`. Original UTF-8 bytes, including line endings, can be reconstructed with `text.encode('utf-8')`. Use `scripts/restore_text.py` to restore the original relative file layout.
|
| 286 |
+
|
| 287 |
+
## Download video shards
|
| 288 |
+
|
| 289 |
+
```python
|
| 290 |
+
from huggingface_hub import snapshot_download
|
| 291 |
+
snapshot_download("PhoebeCC/RoboSteer-Preprocessing", repo_type="dataset",
|
| 292 |
+
revision="v1.0.0", local_dir="robosteer-preprocessing",
|
| 293 |
+
allow_patterns=["level1/image/img_txt_human/*", "level1/manifests/*", "README.md", "SHA256SUMS"])
|
| 294 |
+
```
|
| 295 |
+
|
| 296 |
+
Each tar is independently extractable. The index identifies its repository-relative `shard`, MP4 `member_path`, JSON `metadata_member_path`, and checksums. Video indexes are searchable tables; this release does not configure an embedded-video viewer. Extract each task into a separate folder. MP4 files are preserved byte for byte, without re-encoding.
|
| 297 |
+
|
| 298 |
+
## Provenance and alignment
|
| 299 |
+
|
| 300 |
+
`sample_id` preserves the source filename stem. `source_sample_id` removes only the known task prefix (or audio suffix). Use `(task, sample_id)` as an asset key; use `source_sample_id` to join related tasks, without assuming all tasks cover the same samples. Coverage results are recorded in the validation report.
|
| 301 |
+
|
| 302 |
+
Video metadata originates from existing sidecar JSON files. Metadata text is the original sidecar description, not necessarily the rewritten `text/img_txt` instruction. Image paths are converted to paths relative to the external public-data root. Source duration and generated duration are metadata values, not newly measured properties. The source generator specifies 25 FPS; this packaging run does not probe actual MP4 frame rates. Source images, external task JSONs, model weights, raw audio, audit logs, and organization backups are not bundled.
|
| 303 |
+
|
| 304 |
+
## Rights and citation
|
| 305 |
+
|
| 306 |
+
The repository owner has not yet supplied a release license or complete upstream attribution. No blanket open-source license is asserted for these derived assets. Upstream restrictions remain applicable; consult the owner about permitted redistribution and use. Formal benchmark citation and upstream dataset attribution will be added when supplied.
|
| 307 |
+
|
| 308 |
+
## Reproducibility
|
| 309 |
+
|
| 310 |
+
See `level1/manifests/provenance.json` for packaging rules and generator fingerprints, `assets.json` for counts, and `validation.json` for checks. `SHA256SUMS` covers all payload and documentation files except itself. SHA-256 verification can be performed with `sha256sum -c SHA256SUMS` after a full download. Release tags identify immutable intended snapshots; pin the tag or commit for experiments. Later assets should extend task-specific paths and receive a new version and changelog entry.
|
| 311 |
+
"""
|
| 312 |
+
(release / "README.md").write_text(readme)
|
| 313 |
+
(release / "CHANGELOG.md").write_text("# Changelog\n\n## v1.0.0 — 2026-09-17\n\nInitial Level 1 release: nine processed-text tables, two static-video tasks, original-name recovery, metadata indexes, and SHA-256 verification. No source text rewriting or video re-encoding.\n")
|
| 314 |
+
table = "\n".join(f"| {x['config']} | {x['records']:,} | `{x['path']}` |" for x in texts)
|
| 315 |
+
(release / "level1/README.md").write_text("# Level 1 预处理中间资产\n\n本发布目录独立于工作目录,包含本次选定的整理后文本和 IMG_TXT 条件视频。\n\n| 文本配置 | 条数 | 仓库路径 |\n|---|---:|---|\n" + table + "\n\nHUMAN 与 SKEL 各 14,333 个 MP4,保存在 image/ 下独立 tar 分片中;index.parquet 可定位每个视频及 JSON 元数据。已有 JSON 中的服务器绝对图片路径已改为相对于外部 public 根的路径。\n\n音频类仅包含整理后的动作指令;本发布不含音频实体或转写全文。MUL_BAL 目前仅包含文本。各配置的 data 表示完整资产集合,不代表训练集划分。\n\n详见仓库根 README、manifests/ 清单和 SHA256SUMS。\n")
|
| 316 |
+
write_json(release / "level1/manifests/assets.json", {"version": VERSION, "text": texts, "videos": videos})
|
| 317 |
+
write_json(release / "level1/manifests/validation.json", validation)
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
def main():
|
| 321 |
+
parser = argparse.ArgumentParser()
|
| 322 |
+
parser.add_argument("--source", type=Path, required=True, help="Current level1 work directory")
|
| 323 |
+
parser.add_argument("--release", type=Path, required=True, help="Dedicated publication directory")
|
| 324 |
+
parser.add_argument("--shard-bytes", type=int, default=1024**3)
|
| 325 |
+
args = parser.parse_args()
|
| 326 |
+
assert args.source.resolve() != args.release.resolve()
|
| 327 |
+
args.release.mkdir(parents=True, exist_ok=True)
|
| 328 |
+
text, ids = build_text(args.source, args.release)
|
| 329 |
+
videos = []
|
| 330 |
+
for task in ["IMG_TXT_HUMAN", "IMG_TXT_SKEL"]:
|
| 331 |
+
row, sample_ids = build_video(args.source, args.release, task, args.shard_bytes)
|
| 332 |
+
videos.append(row)
|
| 333 |
+
ids[task] = sample_ids
|
| 334 |
+
validation = {
|
| 335 |
+
"text_records": sum(x["records"] for x in text), "video_records": sum(x["records"] for x in videos),
|
| 336 |
+
"text_utf8_roundtrip_sha256": "passed for every row",
|
| 337 |
+
"video_and_metadata_tar_payload_sha256": "passed for every member",
|
| 338 |
+
"duplicate_asset_ids": 0,
|
| 339 |
+
"human_skel_matching_source_ids": len(ids["IMG_TXT_HUMAN"] & ids["IMG_TXT_SKEL"]),
|
| 340 |
+
"img_text_skel_matching_source_ids": len(ids["img_txt"] & ids["IMG_TXT_SKEL"]),
|
| 341 |
+
"empty_text_records": sum(x["empty_text_records"] for x in text),
|
| 342 |
+
"mp4_decoding_test": "not performed; lossless packaging only",
|
| 343 |
+
}
|
| 344 |
+
assert validation["text_records"] == 213044
|
| 345 |
+
assert validation["human_skel_matching_source_ids"] == 14333
|
| 346 |
+
assert validation["img_text_skel_matching_source_ids"] == 14333
|
| 347 |
+
build_docs(args.release, text, videos, validation)
|
| 348 |
+
scripts = args.release / "scripts"
|
| 349 |
+
scripts.mkdir(exist_ok=True)
|
| 350 |
+
shutil.copy2(__file__, scripts / "build_dataset.py")
|
| 351 |
+
shutil.copy2(Path(__file__).with_name("restore_text.py"), scripts / "restore_text.py")
|
| 352 |
+
generators = [args.source / "img+mul_bal/scripts/build_keyframe_static_videos.py",
|
| 353 |
+
args.source.parent / "GEM/scripts/demo/run_img_txt_video_to_motion_fast.sh"]
|
| 354 |
+
write_json(args.release / "level1/manifests/provenance.json", {
|
| 355 |
+
"release": VERSION, "packaged_date": "2026-09-17", "packaging_script_sha256": digest(Path(__file__)),
|
| 356 |
+
"pyarrow_version": pa.__version__, "text_policy": "strict UTF-8; bytes and line endings preserved",
|
| 357 |
+
"mp4_policy": "unmodified source bytes", "metadata_policy": "external image paths normalized to public-root-relative",
|
| 358 |
+
"shard_target_bytes": args.shard_bytes, "tar_policy": "independent PAX tar, sorted filenames, normalized headers",
|
| 359 |
+
"source_generator_fingerprints": {p.name: digest(p) for p in generators},
|
| 360 |
+
"source_generation_commit": None, "source_generation_commit_note": "Historical generation commit was not recorded",
|
| 361 |
+
})
|
| 362 |
+
checks = []
|
| 363 |
+
for p in sorted(args.release.rglob("*")):
|
| 364 |
+
if p.is_file() and p.name != "SHA256SUMS" and ".cache" not in p.parts:
|
| 365 |
+
checks.append(f"{digest(p)} {p.relative_to(args.release).as_posix()}")
|
| 366 |
+
(args.release / "SHA256SUMS").write_text("\n".join(checks) + "\n")
|
| 367 |
+
log("BUILD_COMPLETE", json.dumps(validation))
|
| 368 |
+
|
| 369 |
+
|
| 370 |
+
if __name__ == "__main__":
|
| 371 |
+
main()
|
scripts/restore_text.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Restore text Parquet assets to their original relative paths, checking hashes."""
|
| 3 |
+
import argparse
|
| 4 |
+
import hashlib
|
| 5 |
+
from pathlib import Path, PurePosixPath
|
| 6 |
+
import pyarrow.parquet as pq
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def main():
|
| 10 |
+
p = argparse.ArgumentParser()
|
| 11 |
+
p.add_argument("--dataset-root", type=Path, required=True)
|
| 12 |
+
p.add_argument("--output", type=Path, required=True)
|
| 13 |
+
args = p.parse_args()
|
| 14 |
+
count = 0
|
| 15 |
+
for base in ["level1/text", "level1/audio"]:
|
| 16 |
+
for parquet in sorted((args.dataset_root / base).rglob("*.parquet")):
|
| 17 |
+
for batch in pq.ParquetFile(parquet).iter_batches(batch_size=4096):
|
| 18 |
+
for row in batch.to_pylist():
|
| 19 |
+
rel = PurePosixPath(row["original_relpath"])
|
| 20 |
+
if rel.is_absolute() or ".." in rel.parts:
|
| 21 |
+
raise ValueError("Unsafe relative path")
|
| 22 |
+
raw = row["text"].encode("utf-8")
|
| 23 |
+
assert hashlib.sha256(raw).hexdigest() == row["sha256"]
|
| 24 |
+
out = args.output / str(rel)
|
| 25 |
+
# Refuse writing outside the requested output tree through symlinks.
|
| 26 |
+
if not out.resolve().is_relative_to(args.output.resolve()):
|
| 27 |
+
raise ValueError("Output path escapes root")
|
| 28 |
+
out.parent.mkdir(parents=True, exist_ok=True)
|
| 29 |
+
if out.exists():
|
| 30 |
+
if out.read_bytes() != raw:
|
| 31 |
+
raise FileExistsError(out)
|
| 32 |
+
else:
|
| 33 |
+
with out.open("xb") as f:
|
| 34 |
+
f.write(raw)
|
| 35 |
+
count += 1
|
| 36 |
+
print(f"Restored and verified {count} text files")
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
if __name__ == "__main__":
|
| 40 |
+
main()
|