| import os |
| import subprocess |
| import sys |
| from pathlib import Path |
|
|
| |
| sys.path.append(str(Path(__file__).parent.parent)) |
|
|
| participants = [f"p{i:02d}" for i in range(15)] |
| processed_dir = 'data/processed' |
| patch_size = 16 |
| suffix = f"_v{patch_size}" |
|
|
| def run_command(cmd): |
| print(f"Executing: {' '.join(cmd)}") |
| subprocess.run(cmd, check=True) |
|
|
| print(f"--- Study A-1 Data Preparation (Resolution: {patch_size}x{patch_size}) ---") |
|
|
| for p in participants: |
| h5_path = os.path.join(processed_dir, f"{p}{suffix}.h5") |
| |
| |
| if not os.path.exists(h5_path): |
| print(f"\n[1/2] Preprocessing {p}...") |
| run_command([sys.executable, "src/data/preprocess_mpii.py", "--patch_size", str(patch_size), "--participants", p]) |
| else: |
| print(f"\n[1/2] {p}{suffix}.h5 already exists. Skipping preprocessing.") |
| |
| |
| |
| print(f"[2/2] Generating teacher labels for {p}{suffix}...") |
| run_command([sys.executable, "src/data/generate_teacher_labels.py", "--participant", f"{p}{suffix}"]) |
|
|
| print("\n--- All 16x16 data prepared with teacher labels! ---") |
|
|