| 34 | |
| 35 | |
| 36 | def parse_args() -> argparse.Namespace: |
| 37 | parser = argparse.ArgumentParser( |
| 38 | description="Compute MBench motion metrics + Gemini alignment to set use_ref_motion." |
| 39 | ) |
| 40 | parser.add_argument( |
| 41 | "--meta-json", |
| 42 | type=Path, |
| 43 | default=Path("data_samples/example_archive_wi_ref_eval.json"), |
| 44 | help="MBench metadata with video_path/mbench_eval_path and without use_ref_motion.", |
| 45 | ) |
| 46 | parser.add_argument( |
| 47 | "--quality-report", |
| 48 | type=Path, |
| 49 | default=Path("data_samples/example_archive_wi_ref_quality.json"), |
| 50 | help="JSON with per-id metrics and decisions.", |
| 51 | ) |
| 52 | parser.add_argument( |
| 53 | "--device", |
| 54 | type=str, |
| 55 | default="cuda" if torch.cuda.is_available() else "cpu", |
| 56 | help="Device for metric computation.", |
| 57 | ) |
| 58 | parser.add_argument( |
| 59 | "--jitter-threshold", |
| 60 | type=float, |
| 61 | default=0.04, |
| 62 | help="Jitter threshold.", |
| 63 | ) |
| 64 | parser.add_argument( |
| 65 | "--gemini-api-key", |
| 66 | type=str, |
| 67 | required=True, |
| 68 | help="Gemini API key.", |
| 69 | ) |
| 70 | parser.add_argument( |
| 71 | "--video-field", |
| 72 | type=str, |
| 73 | default="video_path", |
| 74 | help="Field name in meta JSON that points to the rendered video path.", |
| 75 | ) |
| 76 | parser.add_argument( |
| 77 | "--eval-field", |
| 78 | type=str, |
| 79 | default="mbench_eval_path", |
| 80 | help="Field name in meta JSON that points to the .pt cache with joints.", |
| 81 | ) |
| 82 | parser.add_argument( |
| 83 | "--num-threads", |
| 84 | type=int, |
| 85 | default=2, |
| 86 | help="Parallel Gemini requests.", |
| 87 | ) |
| 88 | parser.add_argument( |
| 89 | "--max-samples", |
| 90 | type=int, |
| 91 | default=None, |
| 92 | help="Optional limit for debugging.", |
| 93 | ) |