File size: 3,290 Bytes
de549a1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | # Pozify Implementation Plan
This plan breaks Pozify into implementation workstreams that can be developed independently while preserving the current JSON data contracts.
## Phase 1: Foundation And Contracts
Goal: make the mocked pipeline production-shaped before replacing mock logic.
Deliverables:
- Stable JSON contracts in `src/pozify/contracts.py`.
- Artifact persistence under `runs/<run_id>/`.
- Contract validation and unit tests.
- Clear step boundaries for replacing mock implementations.
- Seed knowledge card structure.
## Phase 2: Video Intake And Quality Gate
Goal: accept user videos, extract reliable metadata, and reject videos that cannot be analyzed safely.
Deliverables:
- OpenCV-backed video metadata extraction.
- Duration, FPS, brightness, blur, and basic frame-count checks.
- Pose-quality-aware analysis gate.
- User-facing quality warnings.
- Capture guidance for failed videos.
## Phase 3: Pose Extraction And Cleaning
Goal: convert videos into a clean 33-point pose sequence.
Deliverables:
- MediaPipe Pose Landmarker integration.
- Per-frame landmark persistence.
- Pose quality scoring.
- Smoothing and interpolation.
- Coordinate normalization.
## Phase 4: Exercise Router
Goal: classify the video as squat, push-up, shoulder press, or unknown.
Deliverables:
- Pose feature extraction for 30-frame windows.
- Baseline classifier.
- Fine-tuned small temporal classifier.
- Confidence-weighted aggregation.
- Manual fallback when confidence is low.
## Phase 5: Rep Segmentation
Goal: split each exercise into clean reps using transparent state machines.
Deliverables:
- Squat rep counter.
- Push-up rep counter.
- Shoulder press rep counter.
- Partial-rep handling.
- Rep boundary visualization/debug output.
## Phase 6: Rep Analysis And Variation Detection
Goal: compute meaningful metrics per rep and separate valid variations from issues.
Deliverables:
- Common rep metrics.
- Exercise-specific metrics.
- Variation detection rules.
- Aggregate trends such as fatigue and decreasing ROM.
## Phase 7: Frame-Level Issue Markers
Goal: identify exact issue intervals and attach evidence to each issue.
Deliverables:
- Rule-based frame-level issue scores.
- Consecutive-frame thresholding.
- Issue interval grouping.
- Optional temporal issue classifier.
- Evidence payloads for each marker.
## Phase 8: Annotated Video And UI
Goal: make the evidence visible and easy to inspect.
Deliverables:
- Skeleton overlay renderer.
- Red/amber highlights during issue intervals.
- Rep counter overlay.
- Issue thumbnails.
- Gradio report layout with summary, metrics, reps, issues, and JSON evidence tabs.
## Phase 9: Grounded Coach Summary
Goal: generate concise coaching feedback from structured evidence, not model memory.
Deliverables:
- Exercise, variation, issue, goal, and safety knowledge cards.
- Deterministic retrieval.
- SLM prompt contract.
- Summary verifier.
- Conservative fallback summary.
## Phase 10: Dataset, Training, Evaluation, And Demo
Goal: create a defensible small-model story and a reliable hackathon demo.
Deliverables:
- Dataset ingestion scripts.
- Custom data collection guide.
- Training pipeline for the exercise router.
- Evaluation metrics.
- Demo videos.
- README and deployment instructions.
|