Spaces:
Running on T4
Running on T4
File size: 2,467 Bytes
6963661 7bf5a7e 6963661 7bf5a7e | 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 | # Pitch report API
`POST /v1/sessions/{session_id}/pitch-report` takes the ML pitch payload (contract `pitch-1.1`, schema
`docs/pitching-coach-payload.schema.json`, example `docs/pitching-coach-payload.example.json`) for a pitching session
(`mode: "p"`), unchanged. Library entry point: `ai_coach.pitch_report.build_pitch_report(payload, athlete)`
(`pitch_report/v1_1/service.py`). The response follows the swing report layout (overall score, groups, focus area with
a drill, measurements, data quality) plus the pitching sections `coaching` (AI cards), `drill_evaluation` and
`delivery_evidence`.
## Scoring
- Benchmarks: OBP pitching, college pitchers per throwing side (`knowledge/pitching_benchmarks.yaml`). P25–P75 is on
target and P10–P90 satisfactory. OBP has no usable high-school or pro groups, so every level uses college with a
`level_assumed` or `level_approximated` note.
- Throwing side: payload `athlete.throwing_hand`, then the profile, then the opposite of the lead foot. A profile that
disagrees is reported (`throwing_hand_conflict`) and blocks advice.
- Values far outside the P10–P90 band (more than two band widths) are tracking errors: `implausible_value`, not rated.
- A result whose rating changes when an event moves by one frame is shown without a tip and is never the focus
(`event_sensitive_scores`).
- `ankle_span_at_foot_strike_cm` has no OBP equivalent and is shown for reference only.
## Context
| Context | Result |
|---|---|
| fastball, baseball, `standard` drill, any known practice | everything compared |
| any of practice, drill, pitch or ball `unknown` | compared as a regular fastball; leg-lift and stride results are rated but not coached (`practice_context_unknown`) |
| `step_back`, `rocker` | compared, except leg-lift and stride results (`not_comparable_for_drill`) |
| `other` drill, `dry_delivery`, non-fastball, training ball or no ball | described without scores (`practice_context_unverified`) |
## Text
Headline, group summaries, result text, tips and the focus message come from `knowledge/pitch_v1_1_coaching.yaml`
(plain words, no numbers, guarded by the same checks as the swing report). The focus is the lowest-scoring coachable
result with its drill; `maintain` when everything is on target; `general` (rhythm drill) when nothing is coachable.
The AI cards in `coaching` are generated separately and never replace the headline or focus. Coaching text and drill
choices need coach review.
|