AplusX commited on
Commit
ba80d27
·
verified ·
1 Parent(s): d134bef

Add files using upload-large-folder tool

Browse files
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - other
5
+ tags:
6
+ - egocentric
7
+ - pose-estimation
8
+ - RGBD
9
+ - SMPL
10
+ - motion-capture
11
+ size_categories:
12
+ - 10K<n<100K
13
+ ---
14
+
15
+ # EgoPoseVR Dataset
16
+
17
+ ## Overview
18
+
19
+ This dataset contains egocentric RGBD sequences for 3D human pose estimation from a first-person VR perspective.
20
+
21
+ - **Total samples**: 18,235 motion clips
22
+ - **Scenes**: 7 virtual scenes (Scene0 - Scene6)
23
+ - **Train / Val / Test**: 14,702 / 1,827 / 1,706
24
+ - **Total size**: ~362 GB
25
+ - **Data format**: `.npz` (NumPy compressed archives)
26
+
27
+ ## Data Sources
28
+ - CMU Graphics Lab Motion Capture Database
29
+ - BioMotionLab (NTroje) Dataset
30
+
31
+ ## Directory Structure
32
+
33
+ ```
34
+ EgoPoseVR_Dataset/
35
+ ├── Scene{0-6}/ # 7 virtual scenes
36
+ │ └── AllDataPath_{Source}_{split}_{id}/ # motion sequence directory
37
+ │ └── {clip_id}.npz # motion clip file
38
+ ├── train_npz_paths.txt
39
+ ├── val_npz_paths.txt
40
+ ├── test_npz_paths.txt
41
+ └── all_npz_paths.txt
42
+ ```
43
+
44
+ ## NPZ Fields
45
+
46
+ Each `.npz` file represents a motion clip with T consecutive frames (typically T=100).
47
+
48
+ | Field | Shape | Description |
49
+ |---|---|---|
50
+ | `input_rgbd` | (T, 4, H, W) | Input RGBD image sequence (channels 0-2: RGB normalized to [0,1]; channel 3: depth) |
51
+ | `gt_joints_relativeCam_2Dpos` | (T, 22, 2) | GT joint 2D positions projected to camera image plane |
52
+ | `gt_joints_relativePelvis_3Dpos` | (T, 22, 3) | GT joint 3D positions relative to pelvis (pelvis at origin) |
53
+ | `gt_pelvis_camera_3Dpos` | (T, 3) | GT pelvis 3D position in camera coordinate system |
54
+ | `gt_pelvis_camera_4Drot` | (T, 4) | GT pelvis rotation in camera space (quaternion) |
55
+ | `hmd_position_global_full_gt_list` | (T, 54) | HMD global position/orientation data (head + hands) |
56
+ | `head_global_trans_list` | (T, 4, 4) | Head global 4x4 transformation matrices per frame |
57
+ | `body_parms_list` | dict | SMPL body parameters (root_orient, pose_body, trans) |
58
+ | `pred_2d` | (T, 22, 2) | Predicted 2D joint positions from pretrained estimator |
59
+ | `pred_3d` | (T, 22, 3) | Predicted 3D joint positions from pretrained estimator |
60
+
61
+ ## Joint Definition (22 SMPL joints)
62
+
63
+ ```
64
+ 0:Pelvis 1:L_Hip 2:R_Hip 3:Spine1 4:L_Knee 5:R_Knee
65
+ 6:Spine2 7:L_Ankle 8:R_Ankle 9:Spine3 10:L_Foot 11:R_Foot
66
+ 12:Neck 13:L_Collar 14:R_Collar 15:Head 16:L_Shoulder 17:R_Shoulder
67
+ 18:L_Elbow 19:R_Elbow 20:L_Wrist 21:R_Wrist
68
+ ```
all_npz_paths.txt ADDED
The diff for this file is too large to render. See raw diff
 
inspect_dataset.py ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ EgomotionData Dataset Inspector
4
+ ================================
5
+ This script reads and displays the structure, statistics, and field meanings of the EgomotionData dataset.
6
+
7
+ Usage:
8
+ python inspect_dataset.py # View dataset overview + random sample details
9
+ python inspect_dataset.py --sample PATH.npz # View details of a specific npz file
10
+ python inspect_dataset.py --overview-only # View only dataset overview statistics
11
+ python inspect_dataset.py --check-consistency N # Randomly check consistency of N files
12
+ """
13
+
14
+ import argparse
15
+ import os
16
+ import sys
17
+ import random
18
+ import numpy as np
19
+ from pathlib import Path
20
+ from collections import defaultdict
21
+
22
+
23
+ # ============================================================================
24
+ # Data Field Descriptions
25
+ # ============================================================================
26
+ FIELD_DESCRIPTIONS = {
27
+ "input_rgbd": {
28
+ "en": "Input RGBD image sequence",
29
+ "detail": (
30
+ "Shape (T, 4, H, W): T=frames, 4=RGB+Depth channels, H=height, W=width.\n"
31
+ " - Channels 0-2: RGB color image, normalized to [0, 1]\n"
32
+ " - Channel 3: Depth map"
33
+ ),
34
+ },
35
+ "gt_joints_relativeCam_2Dpos": {
36
+ "en": "GT joint 2D positions relative to camera (projected)",
37
+ "detail": (
38
+ "Shape (T, J, 2): T=frames, J=joints(22), 2=pixel coords (x, y).\n"
39
+ " 3D body joints projected onto the camera image plane."
40
+ ),
41
+ },
42
+ "gt_joints_relativePelvis_3Dpos": {
43
+ "en": "GT joint 3D positions relative to pelvis",
44
+ "detail": (
45
+ "Shape (T, J, 3): T=frames, J=joints(22), 3=(x, y, z).\n"
46
+ " 3D joint positions in pelvis-centered local coordinate system.\n"
47
+ " Pelvis joint is always at origin (0, 0, 0)."
48
+ ),
49
+ },
50
+ "gt_pelvis_camera_3Dpos": {
51
+ "en": "GT pelvis 3D position in camera coordinate system",
52
+ "detail": (
53
+ "Shape (T, 3): T=frames, 3=(x, y, z).\n"
54
+ " Absolute 3D position of pelvis in camera space."
55
+ ),
56
+ },
57
+ "gt_pelvis_camera_4Drot": {
58
+ "en": "GT pelvis rotation in camera space (quaternion)",
59
+ "detail": (
60
+ "Shape (T, 4): T=frames, 4=quaternion.\n"
61
+ " Rotation of pelvis joint in camera coordinate system."
62
+ ),
63
+ },
64
+ "hmd_position_global_full_gt_list": {
65
+ "en": "HMD global position/orientation data",
66
+ "detail": (
67
+ "Shape (T, 54): T=frames, 54-dim vector.\n"
68
+ " Global pose information from HMD tracking (head + hands)."
69
+ ),
70
+ },
71
+ "head_global_trans_list": {
72
+ "en": "Head global transformation matrices",
73
+ "detail": (
74
+ "Shape (T, 4, 4): T=frames, 4x4 homogeneous transformation matrix.\n"
75
+ " Head pose (rotation + translation) in global coordinates per frame."
76
+ ),
77
+ },
78
+ "body_parms_list": {
79
+ "en": "SMPL body model parameters",
80
+ "detail": (
81
+ "Dictionary with sub-fields:\n"
82
+ " - root_orient (T, 3): Root (pelvis) rotation in axis-angle\n"
83
+ " - pose_body (T, 63): Body joint poses (21 joints × 3 axis-angle)\n"
84
+ " - trans (T, 3): Global translation (x, y, z)"
85
+ ),
86
+ },
87
+ "pred_2d": {
88
+ "en": "Predicted 2D joint positions",
89
+ "detail": (
90
+ "Shape (T, J, 2): T=frames, J=joints(22), 2=pixel coords (x, y).\n"
91
+ " 2D joint detections from a pretrained pose estimator."
92
+ ),
93
+ },
94
+ "pred_3d": {
95
+ "en": "Predicted 3D joint positions",
96
+ "detail": (
97
+ "Shape (T, J, 3): T=frames, J=joints(22), 3=(x, y, z).\n"
98
+ " 3D joint predictions from a pretrained pose estimator."
99
+ ),
100
+ },
101
+ }
102
+
103
+
104
+ def print_separator(char="=", length=80):
105
+ print(char * length)
106
+
107
+
108
+ def print_header(title):
109
+ print_separator()
110
+ print(f" {title}")
111
+ print_separator()
112
+
113
+
114
+ def get_dataset_root():
115
+ """Return dataset root directory"""
116
+ return Path(__file__).parent
117
+
118
+
119
+ def load_path_file(filepath):
120
+ """Load path list file"""
121
+ if not filepath.exists():
122
+ return []
123
+ with open(filepath, "r") as f:
124
+ return [line.strip() for line in f if line.strip()]
125
+
126
+
127
+ def dataset_overview(root):
128
+ """Print dataset overview"""
129
+ print_header("Dataset Overview")
130
+
131
+ # Scene statistics
132
+ scenes = sorted([d for d in os.listdir(root) if d.startswith("Scene") and os.path.isdir(root / d)])
133
+ print(f"\nNumber of scenes: {len(scenes)}")
134
+
135
+ total_seqs = 0
136
+ total_npz = 0
137
+ source_counter = defaultdict(int)
138
+
139
+ for scene in scenes:
140
+ scene_path = root / scene
141
+ seqs = [d for d in os.listdir(scene_path) if os.path.isdir(scene_path / d)]
142
+ npz_count = 0
143
+ for seq in seqs:
144
+ seq_path = scene_path / seq
145
+ npz_files = [f for f in os.listdir(seq_path) if f.endswith(".npz")]
146
+ npz_count += len(npz_files)
147
+ # Data source extraction
148
+ if "CMU" in seq:
149
+ source_counter["CMU"] += 1
150
+ elif "BioMotionLab_NTroje" in seq:
151
+ source_counter["BioMotionLab_NTroje"] += 1
152
+ else:
153
+ source_counter["Other"] += 1
154
+
155
+ total_seqs += len(seqs)
156
+ total_npz += npz_count
157
+ print(f" {scene}: {len(seqs):>4} sequences, {npz_count:>5} npz files")
158
+
159
+ print(f"\nTotal:")
160
+ print(f" Sequences: {total_seqs}")
161
+ print(f" NPZ files: {total_npz}")
162
+
163
+ # Data source statistics
164
+ print(f"\nData Sources:")
165
+ for src, cnt in sorted(source_counter.items(), key=lambda x: -x[1]):
166
+ print(f" {src}: {cnt} sequences")
167
+
168
+ # Train/Val/Test split
169
+ print(f"\nTrain/Val/Test Split:")
170
+ for split in ["train", "val", "test", "all"]:
171
+ path_file = root / f"{split}_npz_paths.txt"
172
+ paths = load_path_file(path_file)
173
+ print(f" {split:>5}: {len(paths):>6} samples")
174
+
175
+ print()
176
+
177
+
178
+ def inspect_single_npz(npz_path, verbose=True):
179
+ """Inspect the detailed structure of a single npz file"""
180
+ data = np.load(npz_path, allow_pickle=True)
181
+ keys = list(data.keys())
182
+
183
+ if verbose:
184
+ print_header(f"NPZ File Details")
185
+ print(f"Path: {npz_path}")
186
+ print(f"Size: {os.path.getsize(npz_path) / 1024 / 1024:.2f} MB")
187
+ print(f"Number of fields: {len(keys)}")
188
+ print()
189
+
190
+ info = {}
191
+ for key in keys:
192
+ arr = data[key]
193
+ field_info = {"key": key, "dtype": str(arr.dtype), "shape": arr.shape}
194
+
195
+ if arr.dtype == object:
196
+ # Handle dictionary type (body_parms_list)
197
+ obj = arr.item()
198
+ if isinstance(obj, dict):
199
+ field_info["type"] = "dict"
200
+ field_info["sub_fields"] = {}
201
+ for k, v in obj.items():
202
+ field_info["sub_fields"][k] = {
203
+ "shape": v.shape,
204
+ "dtype": str(v.dtype),
205
+ "min": float(v.min()),
206
+ "max": float(v.max()),
207
+ "mean": float(v.mean()),
208
+ }
209
+ else:
210
+ field_info["type"] = "array"
211
+ if arr.size > 0 and arr.dtype.kind in ("f", "i", "u"):
212
+ field_info["min"] = float(arr.min())
213
+ field_info["max"] = float(arr.max())
214
+ field_info["mean"] = float(arr.mean())
215
+ field_info["std"] = float(arr.std())
216
+
217
+ info[key] = field_info
218
+
219
+ if verbose:
220
+ desc = FIELD_DESCRIPTIONS.get(key, {})
221
+ print_separator("-", 70)
222
+ print(f"Field: {key}")
223
+ if desc:
224
+ print(f" Desc: {desc['en']}")
225
+ print(f" Dtype: {arr.dtype}")
226
+ print(f" Shape: {arr.shape}")
227
+
228
+ if field_info["type"] == "dict":
229
+ print(f" Sub-fields:")
230
+ for k, v_info in field_info["sub_fields"].items():
231
+ print(f" - {k}: shape={v_info['shape']}, dtype={v_info['dtype']}, "
232
+ f"range=[{v_info['min']:.4f}, {v_info['max']:.4f}], mean={v_info['mean']:.4f}")
233
+ elif "min" in field_info:
234
+ print(f" Range: [{field_info['min']:.4f}, {field_info['max']:.4f}]")
235
+ print(f" Mean: {field_info['mean']:.4f}, Std: {field_info['std']:.4f}")
236
+
237
+ if desc and "detail" in desc:
238
+ print(f" Details:")
239
+ for line in desc["detail"].split("\n"):
240
+ print(f" {line}")
241
+ print()
242
+
243
+ data.close()
244
+ return info
245
+
246
+
247
+ def print_data_schema():
248
+ """Print complete data schema documentation"""
249
+ print_header("Data Schema Documentation")
250
+ print("""
251
+ Each .npz file represents a motion clip with T consecutive frames (typically T=100).
252
+
253
+ The data is designed for egomotion estimation: recovering 3D human pose from egocentric RGBD views.
254
+
255
+ Directory Structure:
256
+ EgomotionData/
257
+ ├── Scene{0-6}/ # 7 different virtual scenes
258
+ │ └── AllDataPath_{Source}_{split}_{id}/ # motion sequence directory
259
+ │ └── {clip_id}.npz # motion clip file
260
+ ├── train_npz_paths.txt # train set path list
261
+ ├── val_npz_paths.txt # validation set path list
262
+ ├── test_npz_paths.txt # test set path list
263
+ └── all_npz_paths.txt # all paths list
264
+
265
+ Data Sources:
266
+ - CMU: CMU Graphics Lab Motion Capture Database
267
+ - BioMotionLab_NTroje: BioMotionLab (NTroje) Dataset
268
+ """)
269
+
270
+ print("Field Details:")
271
+ print_separator("-", 70)
272
+ for key, desc in FIELD_DESCRIPTIONS.items():
273
+ print(f"\n[{key}]")
274
+ print(f" English: {desc['en']}")
275
+ print(f" Details:")
276
+ for line in desc["detail"].split("\n"):
277
+ print(f" {line}")
278
+ print()
279
+
280
+ print("Joint Definition (22 joints):")
281
+ print(" SMPL model uses 22 joints, typical order:")
282
+ print(" 0:Pelvis 1:L_Hip 2:R_Hip 3:Spine1 4:L_Knee 5:R_Knee")
283
+ print(" 6:Spine2 7:L_Ankle 8:R_Ankle 9:Spine3 10:L_Foot 11:R_Foot")
284
+ print(" 12:Neck 13:L_Collar 14:R_Collar 15:Head 16:L_Shoulder 17:R_Shoulder")
285
+ print(" 18:L_Elbow 19:R_Elbow 20:L_Wrist 21:R_Wrist")
286
+ print()
287
+
288
+
289
+ def check_consistency(root, n_samples=10):
290
+ """Randomly sample and check data consistency"""
291
+ print_header(f"Consistency Check (N={n_samples})")
292
+
293
+ all_paths_file = root / "all_npz_paths.txt"
294
+ all_paths = load_path_file(all_paths_file)
295
+ if not all_paths:
296
+ print("Error: all_npz_paths.txt is empty or does not exist")
297
+ return
298
+
299
+ samples = random.sample(all_paths, min(n_samples, len(all_paths)))
300
+ issues = []
301
+
302
+ for i, rel_path in enumerate(samples, 1):
303
+ # Path format: EgomotionData/Scene0/.../1.npz
304
+ npz_path = root.parent / rel_path
305
+ if not npz_path.exists():
306
+ npz_path = root / "/".join(rel_path.split("/")[1:])
307
+
308
+ if not npz_path.exists():
309
+ issues.append(f"File does not exist: {rel_path}")
310
+ continue
311
+
312
+ try:
313
+ data = np.load(npz_path, allow_pickle=True)
314
+ keys = set(data.keys())
315
+ expected_keys = set(FIELD_DESCRIPTIONS.keys())
316
+
317
+ missing = expected_keys - keys
318
+ extra = keys - expected_keys
319
+
320
+ # Check frame consistency
321
+ T = data["input_rgbd"].shape[0]
322
+ frame_checks = {
323
+ "gt_joints_relativeCam_2Dpos": data["gt_joints_relativeCam_2Dpos"].shape[0],
324
+ "gt_joints_relativePelvis_3Dpos": data["gt_joints_relativePelvis_3Dpos"].shape[0],
325
+ "gt_pelvis_camera_3Dpos": data["gt_pelvis_camera_3Dpos"].shape[0],
326
+ "pred_2d": data["pred_2d"].shape[0],
327
+ "pred_3d": data["pred_3d"].shape[0],
328
+ }
329
+
330
+ frame_mismatch = {k: v for k, v in frame_checks.items() if v != T}
331
+
332
+ status = "OK" if (not missing and not extra and not frame_mismatch) else "WARN"
333
+ print(f" [{i}/{len(samples)}] {status} - {rel_path} (T={T})")
334
+
335
+ if missing:
336
+ msg = f" Missing fields: {missing}"
337
+ print(f" {msg}")
338
+ issues.append(msg)
339
+ if extra:
340
+ print(f" Extra fields: {extra}")
341
+ if frame_mismatch:
342
+ msg = f" Frame count mismatch: {frame_mismatch}"
343
+ print(f" {msg}")
344
+ issues.append(msg)
345
+
346
+ data.close()
347
+ except Exception as e:
348
+ msg = f"Failed to read: {rel_path} - {e}"
349
+ print(f" [{i}/{len(samples)}] ERROR - {msg}")
350
+ issues.append(msg)
351
+
352
+ print()
353
+ if issues:
354
+ print(f"Found {len(issues)} issues:")
355
+ for issue in issues:
356
+ print(f" - {issue}")
357
+ else:
358
+ print("All samples passed consistency check.")
359
+ print()
360
+
361
+
362
+ def main():
363
+ parser = argparse.ArgumentParser(
364
+ description="EgomotionData Dataset Inspector",
365
+ formatter_class=argparse.RawDescriptionHelpFormatter,
366
+ epilog="""
367
+ Examples:
368
+ python inspect_dataset.py # Overview + sample check
369
+ python inspect_dataset.py --overview-only # Show only statistics overview
370
+ python inspect_dataset.py --schema # Show data schema documentation
371
+ python inspect_dataset.py --sample Scene0/xxx/1.npz # Check specific file
372
+ python inspect_dataset.py --check-consistency 20 # Check 20 random files
373
+ """,
374
+ )
375
+ parser.add_argument("--sample", type=str, default=None,
376
+ help="Specify npz file path to inspect")
377
+ parser.add_argument("--overview-only", action="store_true",
378
+ help="Show only dataset overview statistics")
379
+ parser.add_argument("--schema", action="store_true",
380
+ help="Show complete data schema documentation")
381
+ parser.add_argument("--check-consistency", type=int, default=0, metavar="N",
382
+ help="Randomly check consistency of N files")
383
+ parser.add_argument("--seed", type=int, default=42,
384
+ help="Random seed (default: 42)")
385
+
386
+ args = parser.parse_args()
387
+ random.seed(args.seed)
388
+ root = get_dataset_root()
389
+
390
+ if args.schema:
391
+ print_data_schema()
392
+ return
393
+
394
+ if args.sample:
395
+ sample_path = Path(args.sample)
396
+ if not sample_path.is_absolute():
397
+ sample_path = root / args.sample
398
+ if not sample_path.exists():
399
+ print(f"Error: file does not exist - {sample_path}")
400
+ sys.exit(1)
401
+ inspect_single_npz(sample_path)
402
+ return
403
+
404
+ # Default: show overview
405
+ dataset_overview(root)
406
+
407
+ if args.overview_only:
408
+ return
409
+
410
+ # Show data schema
411
+ print_data_schema()
412
+
413
+ # Show details of a random sample
414
+ all_paths = load_path_file(root / "all_npz_paths.txt")
415
+ if all_paths:
416
+ sample_rel = random.choice(all_paths)
417
+ sample_path = root.parent / sample_rel
418
+ if not sample_path.exists():
419
+ sample_path = root / "/".join(sample_rel.split("/")[1:])
420
+ if sample_path.exists():
421
+ print_header("Random Sample Details")
422
+ inspect_single_npz(sample_path)
423
+
424
+ # Consistency check
425
+ n_check = args.check_consistency if args.check_consistency > 0 else 5
426
+ check_consistency(root, n_check)
427
+
428
+
429
+ if __name__ == "__main__":
430
+ main()
test_npz_paths.txt ADDED
The diff for this file is too large to render. See raw diff
 
train_npz_paths.txt ADDED
The diff for this file is too large to render. See raw diff
 
val_npz_paths.txt ADDED
The diff for this file is too large to render. See raw diff