File size: 6,606 Bytes
3249fe4
e798a49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413b142
 
 
 
 
 
 
e798a49
 
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
# Experimental video score

Read **`product.visual_review.score`** from the existing `/product` endpoint.
This is separate from `product.coaching.score`, the measurement-based Mechanics
score. Its accuracy has not been validated.

Gemini rates visible movement against the fixed `visual-swing-v1` rubric. It
returns a grade and explanation, not a numeric score. The server calculates the
points. No new model, SAM, second video or extra model call is required per review.

## Fixed rubric

| Feature | Clear sequence: 2 points | Mixed: 1 point | Needs practice: 0 points |
| --- | --- | --- | --- |
| Preparation and forward movement | Preparation precedes continuous forward hand movement | Preparation precedes forward movement with a visible interruption | A clear reversal/interruption prevents a continuous transition |
| Visible turning order | Hip opening visibly begins before the chest/shoulders turn | They visibly start together | Chest/shoulders visibly turn before hip opening |
| Visible bat movement near the ball | Continuous visible movement into the visible ball region | A visible interruption before that region | A clear reversal/stop interrupts that route |

These are subjective POC pattern criteria, not universal ideals, normal ranges
or proven faults. They do not establish whether a swing was early/late, a real
hip/shoulder separation angle, contact quality or player ability.

Unclear movement gets **no grade and no points**, not zero. Bat/ball grading also
requires directly visible interaction; seeing a ball somewhere in the picture
is insufficient. Every rated feature must cite at least two retained frames
from that same swing. Frame IDs must be chronological and valid.

## Calculation and coverage

At least **two distinct rateable features from the same swing** are required.
Do not combine one feature from Swing 1 and another from Swing 2 to produce a
score. The formula for an eligible swing is:

```text
swing score = round(100 × total rubric points / (2 × number of rated features))
```

Example: preparation is Clear (2), turning order is Mixed (1), and bat/ball is
unclear. That swing gets `75 / 100`, based on **two of three features**. The
unclear feature is excluded. Two Needs practice grades give a legitimate `0 / 100`;
that is different from an unavailable `null` value.

The root `score.value` is the rounded mean of available `rep_scores[].value`.
Unscored swings are excluded from that mean. The current review returns three
feature observations for the session, each tied to a rep; it does not grade all
three features for every swing. Consequently, many multi-swing recordings may
have only one scorable swing, or none. `reviewed_reps`, `scored_reps` and
`rep_scores` make that coverage explicit. Clips still cover all detected swings.

A score of 100 means all **rated rubric criteria** were Clear; it does not mean
the player has a perfect swing. This is not a percentile, probability, accuracy
confidence or a validated progress measure. Different camera views and sampled
frames can change subjective grades; do not rank players or claim improvement
from this number alone.

## Response fields

| Field | Meaning |
| --- | --- |
| `name` | Always `"Experimental video score"`; use this label in the app. |
| `rubric_version` | `"visual-swing-v1"`. |
| `basis` | `"visual_rubric"`. |
| `scope` | `"scorable_reviewed_swings_only"`. |
| `status` | `"available"` or `"unavailable"`. |
| `value` | Integer from 0–100, or null if unavailable. |
| `max_value` | 100. Show `/ 100`, not `% confidence`. |
| `accuracy_validated`, `judgment_eligible` | Both false. Measurement guardrails remain unchanged. |
| `reviewed_reps` | Reps represented by the sampled images. |
| `scored_reps` | Reps that met the same-swing minimum. |
| `rep_scores` | Each reviewed rep's score/status, coverage and feature breakdown. |
| `reason_code` | Null if available; otherwise a fixed reason such as `insufficient_visible_features` or `review_unavailable`. |
| `explanation`, `notice` | Plain-language coverage and limitations. |

Each `rep_scores[]` item contains `rep`, `status`, `value`, `features_scored`,
`features_total: 3`, `reason_code`, `explanation`, and `breakdown`.
Each breakdown item contains `key`, `label`, `status` (`scored`/`unavailable`),
`grade`, `grade_label`, `points`, `max_points: 2`, `reason_code`, `explanation`
and `evidence_frame_ids`. The public feature's optional `rating` also contains
the model's `grade` and `explanation`; unsuitable/unclear ratings are cleared.

## Mobile display

```javascript
const score = product.visual_review.score;
if (score?.status === "available" && score.value !== null) {
  // Show "Experimental video score", `${score.value} / 100`,
  // score.explanation and the per-swing feature explanations.
} else {
  // Show the explanation or hide the numeric score. Never show null as zero.
}
const byRep = new Map((score?.rep_scores ?? []).map(r => [r.rep, r]));
// Match byRep.get(swing.rep) to the existing annotated swing clips.
```

Do not copy this number into `coaching.score`, call it Mechanics score, or use
it to fill missing physical measurements. Keep the three video observations,
drill, supported timing and annotated clips visible even if the score abstains.

## Older reviews and failure behavior

New `poc_video` reviews include the score automatically, using the same Gemini
request. For an older completed review with retained images, explicitly call
`POST /v1/analyses/{job_id}/video-review` once to apply the rubric. This reruns
only the image review and preserves measurements and clip URLs/hashes. It
consumes Gemini quota. A completed current-rubric review is returned unchanged
on subsequent retries, even if it has insufficient evidence for a score.

No model key, disabled review, quota/provider failure or invalid response gives
an unavailable score with `value: null`. Legacy notes without rating fields
remain readable but do not acquire invented grades. Original Mechanics scoring
and measurement eligibility rules are unchanged.

If the model describes contact without confirming visible ball interaction, the
server removes that statement and marks only bat/contact unclear. Valid body
observations remain available, and any priority based on that contact claim is
removed. `visual_review.guardrail_warnings` reports `unverified_contact_statement`
for that feature. Invalid frame references or invented measurements still reject
the review.

The authenticated `/v1/video-score-schema` endpoint and
[video-score.schema.json](video-score.schema.json) publish the full score schema.