Haloroute commited on
Commit
0b97038
·
verified ·
1 Parent(s): 03ee6ad

Update SignBible-MediaPipe dataset card README.md

Browse files
Files changed (1) hide show
  1. README.md +243 -0
README.md ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - translation
4
+ - video-classification
5
+ language:
6
+ - ase
7
+ - bqn
8
+ - esl
9
+ - eso
10
+ - eth
11
+ - gse
12
+ - ins
13
+ - lsb
14
+ - mis
15
+ - mzy
16
+ - nsi
17
+ - nsp
18
+ - rsl
19
+ - sqs
20
+ - tza
21
+ - ugn
22
+ - xki
23
+ license: cc-by-sa-4.0
24
+ datasets:
25
+ - bible-nlp/sign-bibles
26
+ tags:
27
+ - sign-language
28
+ - mediapipe
29
+ - holistic
30
+ - keypoints
31
+ - pose
32
+ - sign-bibles
33
+ - bible-nlp
34
+ configs:
35
+ - config_name: default
36
+ data_files:
37
+ - split: train
38
+ path: "data/shard_*-train.parquet"
39
+ - split: val
40
+ path: "data/shard_*-val.parquet"
41
+ - split: test
42
+ path: "data/shard_*-test.parquet"
43
+ ---
44
+ # SignBible-MediaPipe
45
+
46
+ MediaPipe Holistic 3D keypoint dataset extracted from the `.pose-mediapipe.pose` files of [`bible-nlp/sign-bibles`](https://huggingface.co/datasets/bible-nlp/sign-bibles) across **17 sign languages**, **21 Bible translation projects**, and **1,653 source WebDataset `.tar` shards** (~8,103 estimated samples).
47
+
48
+ - **Storage format**: `zstd`-compressed Parquet shards (`data/shard_XXXXX-{split}.parquet`), capped at **25 videos per shard** to keep memory bounded on long Bible passages.
49
+ - **Array encoding**: The 8 keypoint and confidence tensors are stored as raw C-contiguous `float32` `bytes` (`Value("binary")` in Hugging Face `Features` / `binary` in Arrow) instead of nested Arrow lists, avoiding RAM blow-up during serialization and streaming.
50
+
51
+ ## Keypoints Extraction, Normalization & Face Mesh Masking
52
+
53
+ - **Source format**: `pose-format` binary `.pose-mediapipe.pose` files from `bible-nlp/sign-bibles` (`POSE_LANDMARKS` 33, `FACE_LANDMARKS` 468 or 478, `LEFT_HAND_LANDMARKS` 21, `RIGHT_HAND_LANDMARKS` 21; `POSE_WORLD_LANDMARKS` is omitted). The leading person dimension `(1, T, ...)` is squeezed to `(T, ...)`.
54
+ - **Coordinate normalization**: `x` and `y` pixel coordinates are normalized to `[0, 1]` by dividing by the pose header / video dimensions `(width, height)`, while `z` relative depth is preserved verbatim.
55
+ - **Invalid & missing detections**: Landmarks that are masked in `.pose`, non-finite (`NaN`/`Inf`), or have `conf <= 0` are zeroed out (`0.0`) in both coordinates and confidence so downstream consumers never encounter `NaN` values. Mask frames/landmarks using `*_conf > 0`.
56
+ - **468 vs. 478 Face Landmarks Masking**: Estonian Sign Language (`eso/the_bible_in_estonian_sign_language`) stores 468 face mesh points (omitting the 10 MediaPipe iris landmarks `468:478`). To keep a uniform `(T, 478, 3)` / `(T, 478)` tensor shape across all languages, `face_pts[:, 468:478, :]` is zero-padded (`0.0`) and `face_conf[:, 468:478]` is masked to **`0.0`**. Check `meta["face_landmarks_orig"]` (`468` vs. `478`) to distinguish iris availability.
57
+
58
+ ## Splits & Extraction Summary
59
+
60
+ | Split | Discovered Source `.tar` Shards | Completed Tasks | Failed / Empty | Samples Uploaded |
61
+ | :--- | ---: | ---: | ---: | ---: |
62
+ | `train` | 1153 | — | — | — |
63
+ | `val` | 171 | — | — | — |
64
+ | `test` | 329 | — | — | — |
65
+
66
+ > [!NOTE]
67
+ > The `train` split includes 1 upstream empty 10 KB archive (`ase/chronological_bible_translation_in_american_sign_language_119_introductions_and_passages_expanded_with_more_information/shard_00048-train.tar`) containing 0 `.pose` files because videos larger than 2 GB were omitted upstream.
68
+
69
+ ## Schema & Columns
70
+
71
+ Each row corresponds to one sign-language video clip (`T = duration` frames). The 8 keypoint and confidence columns store raw C-contiguous `float32` `bytes` (4 bytes per float) and are reconstructed with `np.frombuffer(sample[col], dtype=np.float32).reshape(T, ...)`:
72
+
73
+ | Column | Arrow Type | Decoded Shape / Byte Length | Description |
74
+ | :--- | :--- | :--- | :--- |
75
+ | `pose_pts` | `binary` | `float32[T, 33, 3]` (`T * 33 * 3 * 4` B) | Normalized 3D body pose landmarks (`x, y, z`). |
76
+ | `pose_conf` | `binary` | `float32[T, 33]` (`T * 33 * 4` B) | Per-landmark visibility score (`0.0` when missing/masked). |
77
+ | `face_pts` | `binary` | `float32[T, 478, 3]` (`T * 478 * 3 * 4` B) | Normalized 3D face mesh landmarks (`468:478` zero-padded when source has 468 points). |
78
+ | `face_conf` | `binary` | `float32[T, 478]` (`T * 478 * 4` B) | Face landmark confidence (`0.0` for missing frames, masked points, and `468:478` when padded). |
79
+ | `left_hand_pts` | `binary` | `float32[T, 21, 3]` (`T * 21 * 3 * 4` B) | Normalized 3D left-hand landmarks (`x, y, z`). |
80
+ | `left_hand_conf` | `binary` | `float32[T, 21]` (`T * 21 * 4` B) | Left-hand landmark confidence (`0.0` when missing/masked). |
81
+ | `right_hand_pts` | `binary` | `float32[T, 21, 3]` (`T * 21 * 3 * 4` B) | Normalized 3D right-hand landmarks (`x, y, z`). |
82
+ | `right_hand_conf` | `binary` | `float32[T, 21]` (`T * 21 * 4` B) | Right-hand landmark confidence (`0.0` when missing/masked). |
83
+ | `transcript` | `string` | — | Concatenated verse text from `.transcripts.json` (NFC-normalized, `\n`-joined when multiple segments exist). |
84
+ | `fps` | `float32` | scalar | Frame rate from `.pose` header (fallback to sample metadata or `30.0`). |
85
+ | `duration` | `int32` | scalar | Total number of frames `T`. |
86
+ | `key` | `string` | — | Unique identifier: `<split>/<lang>/<project>/<sample_id>`. |
87
+ | `metadata` | `string` | JSON | JSON object (`ensure_ascii=False`) containing original and extraction metadata (fields below). |
88
+
89
+ ## Metadata Fields
90
+
91
+ Every row's `metadata` column is a JSON-encoded string containing the original `.json` fields, verse-aligned `.transcripts.json` segments, and source shard provenance:
92
+
93
+ | Field | Type | Description |
94
+ | :--- | :--- | :--- |
95
+ | `language` | `dict` | Language metadata (`ISO639-3`, `BCP-47`, `name`, `nameLocal`). |
96
+ | `project_name` | `string` | Human-readable Digital Bible Library (DBL) project title. |
97
+ | `copyright` | `list[dict]` | Attribution entries (`name`, `abbr`, `url`) for the sign language translation. |
98
+ | `license` | `string` | Source license string (e.g., `"Creative Commons - Attribution-ShareAlike [CC BY-SA]"`). |
99
+ | `source` | `string` | Digital Bible Library entry URL. |
100
+ | `total_frames` | `int` | Total frame count `T` of the video / pose sequence. |
101
+ | `fps` | `float` | Video frame rate. |
102
+ | `width` | `int` | Source video frame width in pixels (used for `x` normalization). |
103
+ | `height` | `int` | Source video frame height in pixels (used for `y` normalization). |
104
+ | `duration_sec` | `float` | Clip duration in seconds. |
105
+ | `bible-ref` | `string` | Passage reference (e.g., `"LUK 1:1-4"`, `"GEN 9:18-29"`). |
106
+ | `split` | `string` | Dataset split (`"train"`, `"val"`, or `"test"`). |
107
+ | `sample_id` | `string` | Original sample basename inside the WebDataset `.tar` shard. |
108
+ | `lang_code` | `string` | Three-letter ISO 639-3 language folder code (e.g., `"ase"`, `"eso"`, `"xki"`). |
109
+ | `project_slug` | `string` | Project folder slug in `bible-nlp/sign-bibles`. |
110
+ | `face_landmarks_orig` | `int` | Original `FACE_LANDMARKS` count in the source `.pose` (`478` or `468`). |
111
+ | `transcripts` | `list[dict]` | Verse/segment annotations from `.transcripts.json` (`text`, `start_frame`, `end_frame`, `language`, `license`, `source`, `biblenlp-vref`, `bible-ref`). |
112
+ | `tar_shard` | `string` | Source `.tar` path in `bible-nlp/sign-bibles`. |
113
+ | `tar_key` | `string` | Pipeline task key `<split>/<lang>/<project>/shard_XXXXX-<split>`. |
114
+ | `tar_num_samples` | `int` | Number of `.pose-mediapipe.pose` samples in that source `.tar` shard. |
115
+
116
+ Example `metadata` JSON (abbreviated):
117
+
118
+ ```json
119
+ {
120
+ "language": {"ISO639-3": "eso", "BCP-47": "eso", "name": "Estonian Sign Language", "nameLocal": "Eesti viipekeel"},
121
+ "project_name": "The Bible in Estonian Sign Language",
122
+ "copyright": [{"name": "Deaf Bible Society", "abbr": "Deaf Bible", "url": "https://www.deafbiblesociety.com"}],
123
+ "license": "Creative Commons - Attribution-ShareAlike [CC BY-SA]",
124
+ "source": "https://app.thedigitalbiblelibrary.org/entry?id=6ad9cf57ab084a3b",
125
+ "total_frames": 1390,
126
+ "fps": 25.0,
127
+ "width": 3840,
128
+ "height": 2160,
129
+ "duration_sec": 55.6,
130
+ "bible-ref": "LUK 1:1-4",
131
+ "split": "test",
132
+ "sample_id": "eso_the_bible_in_estonian_sign_language_luk_1_1-4",
133
+ "lang_code": "eso",
134
+ "project_slug": "the_bible_in_estonian_sign_language",
135
+ "face_landmarks_orig": 468,
136
+ "transcripts": [
137
+ {
138
+ "text": "...",
139
+ "start_frame": 0,
140
+ "end_frame": 1389,
141
+ "bible-ref": "LUK 1:1-4",
142
+ "biblenlp-vref": [1, 2, 3, 4]
143
+ }
144
+ ],
145
+ "tar_shard": "eso/the_bible_in_estonian_sign_language/shard_00000-test.tar",
146
+ "tar_key": "test/eso/the_bible_in_estonian_sign_language/shard_00000-test",
147
+ "tar_num_samples": 5
148
+ }
149
+ ```
150
+
151
+ ## Source Subsets (`bible-nlp/sign-bibles`)
152
+
153
+ | ISO | Language | Subset (`<lang>/<project>`) | Face Pts | Train | Val | Test | Total Shards | Est. Samples |
154
+ | :--- | :--- | :--- | ---: | ---: | ---: | ---: | ---: | ---: |
155
+ | `ase` | American Sign Language | `ase/chronological_bible_translation_in_american_sign_language_119_introductions_and_passages` | `478` | 28 | 5 | 9 | 42 | 182 |
156
+ | `ase` | American Sign Language | `ase/chronological_bible_translation_in_american_sign_language_119_introductions_and_passages_expanded_with_more_information` | `478` | 35 | 5 | 9 | 49 | 179 |
157
+ | `bqn` | Bulgarian Sign Language | `bqn/chronological_bible_translation_in_bulgarian_sign_language` | `478` | 70 | 10 | 21 | 101 | 505 |
158
+ | `esl` | Egyptian Sign Language | `esl/chronological_bible_translation_in_egyptian_sign_language` | `478` | 7 | 2 | 3 | 12 | 60 |
159
+ | `eso` | Estonian Sign Language | `eso/the_bible_in_estonian_sign_language` | `468` | 13 | 2 | 3 | 18 | 90 |
160
+ | `eth` | Ethiopian Sign Language | `eth/chronological_bible_translation_in_ethiopian_sign_language` | `478` | 76 | 11 | 21 | 108 | 540 |
161
+ | `gse` | Ghanaian Sign Language | `gse/chronological_bible_translation_in_ghanaian_sign_language` | `478` | 75 | 11 | 21 | 107 | 535 |
162
+ | `ins` | Indian (Delhi) Sign Language | `ins/chronological_bible_translation_in_indian_delhi_sign_language` | `478` | 14 | 2 | 4 | 20 | 93 |
163
+ | `lsb` | Burundian Sign Language | `lsb/chronological_bible_translation_in_burundian_sign_language` | `478` | 76 | 11 | 21 | 108 | 540 |
164
+ | `mis` | Andhra Pradesh Sign Language | `mis/chronological_bible_translation_in_andhra_pradesh_sign_language` | `478` | 77 | 11 | 22 | 110 | 550 |
165
+ | `mis` | Kerala Sign Language | `mis/chronological_bible_translation_in_kerala_sign_language` | `478` | 77 | 11 | 22 | 110 | 550 |
166
+ | `mis` | South Sudanese Sign Language | `mis/chronological_bible_translation_in_south_sudanese_sign_language` | `478` | 93 | 14 | 27 | 134 | 625 |
167
+ | `mis` | West Bengal Sign Language | `mis/chronological_bible_translation_in_west_bengal_sign_language` | `478` | 18 | 3 | 5 | 26 | 121 |
168
+ | `mzy` | Mozambican Sign Language | `mzy/chronological_bible_translation_in_mozambican_sign_language` | `478` | 35 | 5 | 10 | 50 | 250 |
169
+ | `nsi` | Nigerian Sign Language | `nsi/chronological_bible_translation_in_nigerian_sign_language` | `478` | 76 | 11 | 21 | 108 | 540 |
170
+ | `nsp` | Nepali Sign Language | `nsp/chronological_bible_translation_in_nepali_sign_language` | `478` | 7 | 1 | 3 | 11 | 55 |
171
+ | `rsl` | Russian Sign Language | `rsl/chronological_bible_translation_in_russian_sign_language` | `478` | 52 | 8 | 15 | 75 | 375 |
172
+ | `sqs` | Sri Lankan Sign Language | `sqs/chronological_bible_translation_in_sri_lankan_sign_language` | `478` | 2 | 1 | 1 | 4 | 13 |
173
+ | `tza` | Tanzanian Sign Language | `tza/chronological_bible_translation_in_tanzanian_sign_language` | `478` | 75 | 11 | 21 | 107 | 535 |
174
+ | `ugn` | Ugandan Sign Language | `ugn/chronological_bible_translation_in_ugandan_sign_language` | `478` | 75 | 11 | 21 | 107 | 535 |
175
+ | `xki` | Kenyan Sign Language | `xki/chronological_bible_translation_in_kenyan_sign_language` | `478` | 172 | 25 | 49 | 246 | 1230 |
176
+ | **Total** | **17 languages / 21 projects** | — | `468` / `478` | **1,153** | **171** | **329** | **1,653** | **8,103** |
177
+
178
+ ## Usage
179
+
180
+ ```python
181
+ import json
182
+ import numpy as np
183
+ from datasets import load_dataset
184
+
185
+ ARRAY_SHAPES = {
186
+ "pose_pts": (33, 3),
187
+ "pose_conf": (33,),
188
+ "face_pts": (478, 3),
189
+ "face_conf": (478,),
190
+ "left_hand_pts": (21, 3),
191
+ "left_hand_conf": (21,),
192
+ "right_hand_pts": (21, 3),
193
+ "right_hand_conf": (21,),
194
+ }
195
+
196
+
197
+ def decode_keypoints(sample: dict) -> dict[str, np.ndarray]:
198
+ """Decode all 8 binary columns in a sample row to float32 numpy arrays."""
199
+ t = int(sample["duration"])
200
+ return {
201
+ col: np.frombuffer(sample[col], dtype=np.float32).reshape(t, *tail)
202
+ for col, tail in ARRAY_SHAPES.items()
203
+ }
204
+
205
+
206
+ # Stream shards directly without downloading the whole dataset
207
+ ds = load_dataset("Haloroute/SignBible-MediaPipe", split="train", streaming=True)
208
+ sample = next(iter(ds))
209
+ kpts = decode_keypoints(sample)
210
+ meta = json.loads(sample["metadata"])
211
+
212
+ print(sample["key"], kpts["pose_pts"].shape, meta.get("face_landmarks_orig"), meta.get("bible-ref"))
213
+
214
+ # Mask missing detections (confidence > 0.0; iris 468:478 is 0.0 when face_landmarks_orig == 468)
215
+ lh_detected_frames = kpts["left_hand_conf"][:, 0] > 0.0
216
+ face_valid_mask = kpts["face_conf"] > 0.0
217
+
218
+ # Slice keypoints for each verse / transcript segment
219
+ for seg in meta.get("transcripts", []):
220
+ s, e = int(seg["start_frame"]), int(seg["end_frame"])
221
+ seg_pose = kpts["pose_pts"][s : e + 1]
222
+ print(seg.get("bible-ref"), seg.get("biblenlp-vref"), seg_pose.shape, seg["text"][:80])
223
+ ```
224
+
225
+ ## Source Notes & Known Issues
226
+
227
+ - **Videos larger than 2 GB are omitted upstream** in [`bible-nlp/sign-bibles`](https://huggingface.co/datasets/bible-nlp/sign-bibles) due to PyArrow `ArrowCapacityError` ([huggingface/datasets#7691](https://github.com/huggingface/datasets/issues/7691)); see [BibleNLP/sign-bibles-dataset#22](https://github.com/BibleNLP/sign-bibles-dataset/issues/22). This leaves 1 empty archive (`ase/chronological_bible_translation_in_american_sign_language_119_introductions_and_passages_expanded_with_more_information/shard_00048-train.tar`, 10 KB, 0 samples).
228
+ - **Non-square pixel aspect ratio**: Some source videos had non-square pixels, which can horizontally squeeze frames and keypoints computed from them; see [BibleNLP/sign-bibles-dataset#45](https://github.com/BibleNLP/sign-bibles-dataset/issues/45).
229
+ - **Gloss annotations**: Timestamped ASL gloss annotations for 10 videos (679 annotations) are available in [`bible-nlp/sign-bibles` (`osb_glosses`)](https://huggingface.co/datasets/bible-nlp/sign-bibles/blob/main/osb_glosses/README.md).
230
+
231
+ ## License & Citation
232
+
233
+ Derived from [`bible-nlp/sign-bibles`](https://huggingface.co/datasets/bible-nlp/sign-bibles) under **CC BY-SA 4.0**. Please check individual sample `metadata` (`copyright`, `license`, `source`) for specific attribution requirements and cite:
234
+
235
+ ```bibtex
236
+ @misc{leong2026osb,
237
+ title = {Open Sign Bibles ({OSB}): An Open-Access Multilingual Sign Language Bibles Dataset},
238
+ author = {Leong, Colin and Nemecek, Joshua and Raju, Kavitha and Mathew, Joel and Asari, Vijayan and Leong, Elisabeth},
239
+ year = {2026},
240
+ howpublished = {Research Square preprint},
241
+ doi = {10.21203/rs.3.rs-7918028/v1}
242
+ }
243
+ ```