Spaces:
Running on T4
Running on T4
github-actions[bot] commited on
Commit ·
f771d3b
1
Parent(s): 326d3cc
Automated Deploy: 9f9dcd1425f5662781079a75792f7ca4a14aded6
Browse files- baseball_batting/api_output.py +6 -3
- baseball_batting/batting_measurements.py +178 -45
- baseball_batting/body2d.py +16 -1
- baseball_batting/detection.py +16 -0
- baseball_batting/observations.py +3 -3
- configs/resources.yaml +6 -3
- docs/API_FOR_COACH.md +2 -2
- docs/BATTING_2D_MEASUREMENTS.md +25 -11
- docs/api-result.schema.json +1 -1
- notebooks/batting_2d_test.ipynb +10 -3
- tests/fixtures/walkthrough_pose.json +1 -0
- tests/test_2d_regressions.py +127 -0
- tests/test_api.py +1 -1
- tests/test_batting_measurements.py +12 -3
- tests/test_colab_2d.py +5 -0
- tools/build_2d_notebook.py +10 -3
- tools/preview_swing_ranges.py +11 -2
baseball_batting/api_output.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
"""Raw 2D pose plus estimated swing measurements; no coaching decisions."""
|
| 2 |
import math
|
| 3 |
import numpy as np
|
|
|
|
|
|
|
| 4 |
from .contracts import json_safe
|
| 5 |
from .batting_measurements import analyze_batting, coach_payload
|
| 6 |
|
|
@@ -71,6 +73,7 @@ def build_api_result(capture, observations, options, model_hashes):
|
|
| 71 |
warnings = ["Point scores are model scores; their accuracy has not been calibrated."]
|
| 72 |
if not known_clock:
|
| 73 |
warnings.append("Capture time is unknown: t_s and capture_fps are null. playback_t_s is not capture time.")
|
|
|
|
| 74 |
result = {"schema_version": "1.0", "status": "partial", "warnings": warnings,
|
| 75 |
"pose_track": {"schema_version": "1.0", "discipline": "hitting", "view": options.view,
|
| 76 |
"video": {"width": width, "height": height, "frame_count": n,
|
|
@@ -80,11 +83,11 @@ def build_api_result(capture, observations, options, model_hashes):
|
|
| 80 |
"time_source": ("original_pts" if options.timing.kind == "unretimed" else
|
| 81 |
"slowmo_rescaled" if options.timing.kind == "constant_slowdown" else
|
| 82 |
"explicit_capture_times" if options.timing.kind == "explicit" else "unknown") if known_clock else "unknown"},
|
| 83 |
-
"model": {"name": "RTMW-x", "version":
|
| 84 |
"sha256": model_hashes["body_pose"], "person_detector": "YOLOX-m HumanArt c2c7a14a",
|
| 85 |
"person_detector_sha256": model_hashes["person_detector"],
|
| 86 |
-
"processing": ["score_threshold_0.35", "out_of_image_points_removed", "scores_clipped_0_1", "no_smoothing_or_gap_filling"],
|
| 87 |
-
"people_rule": "largest area times score initially; maximum overlap thereafter; reject overlap below 0.05",
|
| 88 |
"blur_definition": "1/(1+grayscale_laplacian_variance/100); heuristic, not calibrated"},
|
| 89 |
"keypoint_order": KEYPOINT_ORDER, "extra_keypoint_order": EXTRA_ORDER,
|
| 90 |
"frames": frames, "reps": []},
|
|
|
|
| 1 |
"""Raw 2D pose plus estimated swing measurements; no coaching decisions."""
|
| 2 |
import math
|
| 3 |
import numpy as np
|
| 4 |
+
import yaml
|
| 5 |
+
from .config import CONFIG_ROOT
|
| 6 |
from .contracts import json_safe
|
| 7 |
from .batting_measurements import analyze_batting, coach_payload
|
| 8 |
|
|
|
|
| 73 |
warnings = ["Point scores are model scores; their accuracy has not been calibrated."]
|
| 74 |
if not known_clock:
|
| 75 |
warnings.append("Capture time is unknown: t_s and capture_fps are null. playback_t_s is not capture time.")
|
| 76 |
+
pose_version = yaml.safe_load((CONFIG_ROOT / "resources.yaml").read_text())["resources"]["body_pose"]["version"]
|
| 77 |
result = {"schema_version": "1.0", "status": "partial", "warnings": warnings,
|
| 78 |
"pose_track": {"schema_version": "1.0", "discipline": "hitting", "view": options.view,
|
| 79 |
"video": {"width": width, "height": height, "frame_count": n,
|
|
|
|
| 83 |
"time_source": ("original_pts" if options.timing.kind == "unretimed" else
|
| 84 |
"slowmo_rescaled" if options.timing.kind == "constant_slowdown" else
|
| 85 |
"explicit_capture_times" if options.timing.kind == "explicit" else "unknown") if known_clock else "unknown"},
|
| 86 |
+
"model": {"name": "RTMW-x", "version": pose_version,
|
| 87 |
"sha256": model_hashes["body_pose"], "person_detector": "YOLOX-m HumanArt c2c7a14a",
|
| 88 |
"person_detector_sha256": model_hashes["person_detector"],
|
| 89 |
+
"processing": ["score_threshold_0.35", "foot_ankle_distance_guard", "out_of_image_points_removed", "scores_clipped_0_1", "no_smoothing_or_gap_filling"],
|
| 90 |
+
"people_rule": "largest area times score initially; maximum overlap thereafter; reject overlap below 0.05; count secondary proposals only above max(15% image height, 35% athlete height)",
|
| 91 |
"blur_definition": "1/(1+grayscale_laplacian_variance/100); heuristic, not calibrated"},
|
| 92 |
"keypoint_order": KEYPOINT_ORDER, "extra_keypoint_order": EXTRA_ORDER,
|
| 93 |
"frames": frames, "reps": []},
|
baseball_batting/batting_measurements.py
CHANGED
|
@@ -9,7 +9,7 @@ import math
|
|
| 9 |
import numpy as np
|
| 10 |
from scipy.ndimage import median_filter
|
| 11 |
|
| 12 |
-
VERSION = "batting-2d-
|
| 13 |
EVENT_ORDER = ["stance_set", "load_start", "stride", "foot_contact", "foot_plant",
|
| 14 |
"swing_start", "contact", "finish"]
|
| 15 |
METRICS = {
|
|
@@ -62,6 +62,19 @@ def analysis_points(points, max_gap=3):
|
|
| 62 |
return result
|
| 63 |
|
| 64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
def included_angle(a, b, c):
|
| 66 |
u, v = np.asarray(a)-b, np.asarray(c)-b
|
| 67 |
den = np.linalg.norm(u, axis=-1) * np.linalg.norm(v, axis=-1)
|
|
@@ -96,7 +109,7 @@ def motion_clock(frames):
|
|
| 96 |
return np.arange(len(frames["kp"]), dtype=float), 1.
|
| 97 |
|
| 98 |
|
| 99 |
-
def direction_from_stance(points, options, height):
|
| 100 |
if options.pitcher_direction:
|
| 101 |
return -1 if options.pitcher_direction == "image_left" else 1
|
| 102 |
if not options.handedness or height is None:
|
|
@@ -106,7 +119,15 @@ def direction_from_stance(points, options, height):
|
|
| 106 |
finite = delta[np.isfinite(delta)]
|
| 107 |
if len(finite) < 5 or abs(float(np.median(finite))) < .04*height:
|
| 108 |
return None
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
|
| 112 |
def hand_motion(points, height, direction):
|
|
@@ -139,7 +160,7 @@ def candidate_bursts(relative, magnitude, forward, threshold, dt, direction):
|
|
| 139 |
continue
|
| 140 |
path = relative[a-1:b]
|
| 141 |
excursion = (direction * (path[-1, 0]-path[0, 0]) if direction
|
| 142 |
-
else float(np.linalg.norm(path
|
| 143 |
if excursion < .12:
|
| 144 |
continue
|
| 145 |
# Motion without direction is only a generic rep candidate. It never
|
|
@@ -152,23 +173,83 @@ def candidate_bursts(relative, magnitude, forward, threshold, dt, direction):
|
|
| 152 |
return bursts
|
| 153 |
|
| 154 |
|
| 155 |
-
def
|
| 156 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
_, relative, magnitude, _, threshold = motion
|
| 158 |
minimum = max(3, min(12, round(.035/dt)))
|
| 159 |
quiet = np.isfinite(magnitude) & (magnitude < threshold*.3)
|
| 160 |
backward = (np.r_[False, direction*np.diff(relative[:, 0]) < -threshold*.6]
|
| 161 |
if direction else np.zeros(n, bool))
|
| 162 |
-
margin = max(minimum+2, min(
|
| 163 |
output = []
|
| 164 |
for index, (a, b, peak) in enumerate(bursts):
|
| 165 |
left = 0 if index == 0 else (bursts[index-1][2]+peak)//2+1
|
| 166 |
right = n-1 if index+1 == len(bursts) else (peak+bursts[index+1][2])//2
|
| 167 |
if left > a or right < b-1: continue
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
after = [(s+b, e+b) for s, e in runs(quiet[b:right+1]) if e-s >= minimum]
|
| 173 |
end = min(right, after[0][0]+minimum+2) if after else right
|
| 174 |
output.append((start, end))
|
|
@@ -190,11 +271,26 @@ def capture_checks(track, options, height, selected_frames):
|
|
| 190 |
if any(x is None for x in counts):
|
| 191 |
diagnostics.append("Person counts are unavailable for some analyzed frames.")
|
| 192 |
width, video_height = track["video"]["width"], track["video"]["height"]
|
|
|
|
| 193 |
if present:
|
| 194 |
if np.median([b[3]-b[1] for b in present]) < .18*video_height or (height and height < 120):
|
| 195 |
reasons.append("person_too_small")
|
| 196 |
-
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
reasons.append("partly_out_of_frame")
|
| 199 |
jumps = 0
|
| 200 |
for previous, current, a, b in zip(ids, ids[1:], boxes, boxes[1:]):
|
|
@@ -204,7 +300,6 @@ def capture_checks(track, options, height, selected_frames):
|
|
| 204 |
if jumps:
|
| 205 |
reasons.append("player_switched")
|
| 206 |
diagnostics.append("A large adjacent-frame box jump suggests a camera cut or identity change.")
|
| 207 |
-
kp = point_array(f["kp"], 17)[ids]
|
| 208 |
core = [0, 5, 6, 11, 12, 15, 16]
|
| 209 |
complete = np.isfinite(kp[:, core]).all(axis=(1, 2))
|
| 210 |
if complete.mean() < .8: reasons.append("low_pose_confidence")
|
|
@@ -223,7 +318,7 @@ def capture_checks(track, options, height, selected_frames):
|
|
| 223 |
diagnostics.append("Capture FPS is unknown or variable; timing metrics are withheld.")
|
| 224 |
if options.view != "face_on": reasons.append("view_uncertain")
|
| 225 |
if options.camera_stability != "fixed_verified":
|
| 226 |
-
diagnostics.append("Camera stability is unverified or moving;
|
| 227 |
reasons = list(dict.fromkeys(reasons))
|
| 228 |
return {"ok": not any(r in FATAL_REASONS for r in reasons), "reasons": reasons}, diagnostics
|
| 229 |
|
|
@@ -235,21 +330,34 @@ def infer_events(track, points, options, height, direction, motion, start, end):
|
|
| 235 |
raw_feet = point_array(track["frames"]["kp_extra"], 6)
|
| 236 |
feet = analysis_points(raw_feet)
|
| 237 |
events, missing = {}, {key: "No sufficient 2D evidence." for key in EVENT_ORDER}
|
| 238 |
-
if options.view != "face_on" or options.camera_stability != "fixed_verified":
|
| 239 |
-
return events, {key: "A declared face-on, fixed-camera recording is required." for key in EVENT_ORDER}
|
| 240 |
if height is None:
|
| 241 |
return events, {key: "Body scale is unavailable." for key in EVENT_ORDER}
|
| 242 |
minimum = max(3, min(12, round(.035 / dt)))
|
| 243 |
-
|
| 244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
if not positive:
|
| 246 |
return events, missing
|
| 247 |
# A caller-declared range with two clear drives is ambiguous. Never silently
|
| 248 |
# select the best peak and call that range one swing.
|
| 249 |
-
if len(positive)
|
| 250 |
-
|
|
|
|
|
|
|
| 251 |
a, b, peak = positive[0]
|
| 252 |
a, b, peak = a+start, b+start, peak+start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
def add(name, frame, method, note, joints=(9, 10, 11, 12)):
|
| 254 |
if frame < start or frame > end or not np.isfinite(raw[frame, list(joints)]).all():
|
| 255 |
return
|
|
@@ -259,16 +367,30 @@ def infer_events(track, points, options, height, direction, motion, start, end):
|
|
| 259 |
t = track["frames"]["t_s"][frame]
|
| 260 |
if t is not None: event["t_s"] = float(t)
|
| 261 |
events[name] = event; missing.pop(name, None)
|
| 262 |
-
if direction is not None:
|
| 263 |
add("swing_start", a, "sustained_forward_hand_motion_v1",
|
| 264 |
"Estimated onset of sustained forward hand displacement; acceleration onset is not validated.")
|
| 265 |
else:
|
| 266 |
-
|
|
|
|
| 267 |
quiet = np.isfinite(magnitude) & (magnitude < threshold*.3)
|
| 268 |
quiet_runs = [(s, e) for s, e in runs(quiet[start:a]) if e-s >= minimum]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
# Last visible backward hand excursion before the forward drive.
|
| 270 |
if direction is not None:
|
| 271 |
-
backward = np.r_[False, direction*np.diff(relative[:, 0]) < -threshold*.
|
| 272 |
loads = []
|
| 273 |
for s, e in runs(backward[start:a]):
|
| 274 |
s, e = s+start, e+start
|
|
@@ -283,7 +405,7 @@ def infer_events(track, points, options, height, direction, motion, start, end):
|
|
| 283 |
preparation_end = events.get("load_start", {"frame": a})["frame"]
|
| 284 |
quiet_runs = [(s, e) for s, e in quiet_runs if start+e <= preparation_end]
|
| 285 |
if quiet_runs:
|
| 286 |
-
q, stop = quiet_runs[
|
| 287 |
add("stance_set", start+q, "pre_drive_quiet_hands_v1",
|
| 288 |
"Stable hands are a stance estimate, not proof of a complete stance.")
|
| 289 |
lead = 0 if options.handedness == "right" else 1 if options.handedness == "left" else None
|
|
@@ -309,7 +431,10 @@ def infer_events(track, points, options, height, direction, motion, start, end):
|
|
| 309 |
missing["contact"] = "A visible forward lead-arm extension peak was not found."
|
| 310 |
else:
|
| 311 |
missing["contact"] = "Handedness and pitcher direction are required for the contact estimate."
|
| 312 |
-
if
|
|
|
|
|
|
|
|
|
|
| 313 |
ankle = 15+lead
|
| 314 |
back_ankle = 16-lead
|
| 315 |
prep_end = events.get("load_start", events.get("swing_start", {"frame": a}))["frame"]
|
|
@@ -373,11 +498,6 @@ def infer_events(track, points, options, height, direction, motion, start, end):
|
|
| 373 |
else:
|
| 374 |
for key in ("stride", "foot_contact", "foot_plant"):
|
| 375 |
missing[key] = "Handedness is required to identify the lead foot."
|
| 376 |
-
for s, e in runs(quiet[max(b, start):end+1]):
|
| 377 |
-
if e-s >= minimum and max(b, start)+s+minimum-1 < end:
|
| 378 |
-
add("finish", max(b, start)+s, "post_drive_quiet_hands_v1",
|
| 379 |
-
"Estimated post-swing settling; the last clip frame is not used as finish.")
|
| 380 |
-
break
|
| 381 |
prior = start
|
| 382 |
for key in EVENT_ORDER:
|
| 383 |
if key not in events: continue
|
|
@@ -395,24 +515,32 @@ def rep_metrics(track, points, options, height, height_method, direction, events
|
|
| 395 |
if not capture["ok"]:
|
| 396 |
reason = "Capture failed: " + ", ".join(capture["reasons"])
|
| 397 |
elif options.view != "face_on": reason = "A declared face-on recording is required."
|
| 398 |
-
elif not fixed: reason = "Fixed-camera evidence is required."
|
| 399 |
elif height is None: reason = "Body-height scale is unavailable."
|
| 400 |
else: reason = None
|
| 401 |
def frame(name): return events[name]["frame"] if name in events else None
|
| 402 |
plant, contact, stance, load, onset = map(frame, ("foot_plant", "contact", "stance_set", "load_start", "swing_start"))
|
| 403 |
if reason is None and lead is not None:
|
| 404 |
ankle, back = 15+lead, 16-lead
|
| 405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 406 |
values["stride_pct_height"] = abs(points[plant, ankle, 0]-points[plant, back, 0]) / height*100
|
| 407 |
notes["stride_pct_height"] = scale_note + " Horizontal ankle span at settled-foot proxy; full body-weight loading unmeasured."
|
| 408 |
-
if contact is not None and
|
| 409 |
hip_x = (points[contact, 11, 0]+points[contact, 12, 0])/2
|
| 410 |
values["com_drift_pct_height"] = direction*(hip_x-points[contact, ankle, 0]) / height*100
|
| 411 |
notes["com_drift_pct_height"] = scale_note + " Hip midpoint relative to front ankle; negative means behind; not whole-body center of mass."
|
| 412 |
-
if contact is not None:
|
| 413 |
hip, knee = (11, 13) if lead == 0 else (12, 14)
|
| 414 |
values["lead_knee_angle_contact_deg"] = included_angle(points[contact, hip], points[contact, knee], points[contact, ankle])
|
| 415 |
notes["lead_knee_angle_contact_deg"] = "Reference only: projected interior knee angle at estimated contact; face-on projection does not measure anatomical flexion."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
fps = track["video"]["capture_fps"]
|
| 417 |
timing_reason = ("Real capture timing is unknown or variable." if fps is None else
|
| 418 |
"Timing measurements require real capture FPS >= 60." if fps < 60-1e-6 else None)
|
|
@@ -428,18 +556,20 @@ def rep_metrics(track, points, options, height, height_method, direction, events
|
|
| 428 |
if contact is not None and real_times[contact] > real_times[onset]:
|
| 429 |
values["load_launch_ratio"] = duration / (real_times[contact]-real_times[onset])
|
| 430 |
notes["load_launch_ratio"] = "Estimated load duration divided by forward onset-to-contact duration."
|
| 431 |
-
if reason is None and stance is not None and contact is not None:
|
| 432 |
-
nose =
|
| 433 |
if len(nose) >= 2 and np.isfinite(nose).all():
|
| 434 |
values["head_movement_pct_height"] = np.linalg.norm(np.diff(nose, axis=0), axis=1).sum() / height*100
|
| 435 |
notes["head_movement_pct_height"] = scale_note + " Reference-only smoothed nose path from stance to estimated contact; not calibrated for judging."
|
| 436 |
missing = {
|
| 437 |
-
"stride_pct_height": "
|
|
|
|
| 438 |
"com_drift_pct_height": "Lead-foot identity, pitcher direction or estimated contact is missing.",
|
| 439 |
"foot_plant_to_contact_ms": timing_reason or "Estimated foot plant or contact is missing.",
|
| 440 |
"load_tempo_s": timing_reason or "Load start or forward swing onset is missing.",
|
| 441 |
"load_launch_ratio": timing_reason or "Load start, forward swing onset or contact is missing.",
|
| 442 |
-
"head_movement_pct_height": "
|
|
|
|
| 443 |
"lead_knee_angle_contact_deg": "Lead-leg identity or estimated contact is missing.",
|
| 444 |
"lateral_trunk_tilt_contact_deg": "Unavailable: face-on 2D cannot establish the requested anatomical trunk tilt.",
|
| 445 |
"hip_shoulder_separation_foot_plant_deg": "Unavailable: image-plane line angles do not measure axial hip-shoulder twist.",
|
|
@@ -458,13 +588,13 @@ def rep_metrics(track, points, options, height, height_method, direction, events
|
|
| 458 |
|
| 459 |
def analyze_batting(track, options):
|
| 460 |
raw = point_array(track["frames"]["kp"], 17)
|
| 461 |
-
points =
|
| 462 |
height, height_method = stature(points, options)
|
| 463 |
if height is not None and height > 2*math.hypot(track["video"]["width"], track["video"]["height"]):
|
| 464 |
height, height_method = None, "body-height scale exceeds the image geometry"
|
| 465 |
-
direction = direction_from_stance(points, options, height)
|
| 466 |
-
motion = hand_motion(points, height, direction)
|
| 467 |
_, dt = motion_clock(track["frames"])
|
|
|
|
|
|
|
| 468 |
n = len(raw)
|
| 469 |
declared = [(r.start_frame, r.end_frame) for r in options.reps]
|
| 470 |
if options.single_swing: declared = [(0, n-1)]
|
|
@@ -472,8 +602,8 @@ def analyze_batting(track, options):
|
|
| 472 |
ranges = declared
|
| 473 |
boundary_method = "caller_declared_single_swing" if options.single_swing else "caller_supplied"
|
| 474 |
elif height is not None:
|
| 475 |
-
bursts =
|
| 476 |
-
ranges = automatic_ranges(bursts, motion, dt, direction, n)
|
| 477 |
boundary_method = "automatic_2d_hand_motion_candidate"
|
| 478 |
else:
|
| 479 |
ranges = []; boundary_method = "automatic_2d_hand_motion_candidate"
|
|
@@ -501,11 +631,14 @@ def analyze_batting(track, options):
|
|
| 501 |
warnings = ["All event detections and non-null swing measurements are unvalidated 2D estimates.",
|
| 502 |
"Foot plant is a settled-foot proxy; full body-weight loading is not measured.",
|
| 503 |
"Contact is a lead-arm extension estimate; no bat-ball collision is confirmed."] + diagnostics + limit_warning
|
|
|
|
|
|
|
| 504 |
if not ranges: warnings.append("No separable swing candidates found; no rep or measurements fabricated.")
|
| 505 |
return pose_reps, measurement_reps, capture, warnings, {
|
| 506 |
"version": VERSION, "body_height_px": height, "body_height_method": height_method,
|
| 507 |
"pitcher_direction": "image_right" if direction == 1 else "image_left" if direction == -1 else None,
|
| 508 |
-
"processing": ["interior_gap_fill_max_3_frames", "
|
|
|
|
| 509 |
"validation": "reference_validation_pending"}
|
| 510 |
|
| 511 |
|
|
|
|
| 9 |
import numpy as np
|
| 10 |
from scipy.ndimage import median_filter
|
| 11 |
|
| 12 |
+
VERSION = "batting-2d-v2"
|
| 13 |
EVENT_ORDER = ["stance_set", "load_start", "stride", "foot_contact", "foot_plant",
|
| 14 |
"swing_start", "contact", "finish"]
|
| 15 |
METRICS = {
|
|
|
|
| 62 |
return result
|
| 63 |
|
| 64 |
|
| 65 |
+
def analysis_body_points(raw):
|
| 66 |
+
"""Smooth body-relative geometry before restoring the image position.
|
| 67 |
+
|
| 68 |
+
Median-filtering each absolute joint separately is not invariant to camera
|
| 69 |
+
translation. It can shift hand onset by a frame even for an otherwise
|
| 70 |
+
identical swing. Hip-relative filtering keeps those events/angles consistent.
|
| 71 |
+
"""
|
| 72 |
+
hips = (raw[:, 11]+raw[:, 12])/2
|
| 73 |
+
relative = analysis_points(raw-hips[:, None, :])
|
| 74 |
+
origin = analysis_points(hips[:, None, :])[:, 0]
|
| 75 |
+
return relative+origin[:, None, :]
|
| 76 |
+
|
| 77 |
+
|
| 78 |
def included_angle(a, b, c):
|
| 79 |
u, v = np.asarray(a)-b, np.asarray(c)-b
|
| 80 |
den = np.linalg.norm(u, axis=-1) * np.linalg.norm(v, axis=-1)
|
|
|
|
| 109 |
return np.arange(len(frames["kp"]), dtype=float), 1.
|
| 110 |
|
| 111 |
|
| 112 |
+
def direction_from_stance(points, options, height, dt=1.):
|
| 113 |
if options.pitcher_direction:
|
| 114 |
return -1 if options.pitcher_direction == "image_left" else 1
|
| 115 |
if not options.handedness or height is None:
|
|
|
|
| 119 |
finite = delta[np.isfinite(delta)]
|
| 120 |
if len(finite) < 5 or abs(float(np.median(finite))) < .04*height:
|
| 121 |
return None
|
| 122 |
+
direction = int(np.sign(np.median(finite)))
|
| 123 |
+
# Cross-steps or incorrect handedness can reverse ankle ordering. Do not
|
| 124 |
+
# let that turn a follow-through into the forward swing. Only accept the
|
| 125 |
+
# stance sign when it agrees with the strongest short hand excursion.
|
| 126 |
+
motion = hand_motion(points, height, None)
|
| 127 |
+
drive = motion_direction(motion, dt)
|
| 128 |
+
if drive is not None and drive != direction:
|
| 129 |
+
return None
|
| 130 |
+
return direction
|
| 131 |
|
| 132 |
|
| 133 |
def hand_motion(points, height, direction):
|
|
|
|
| 160 |
continue
|
| 161 |
path = relative[a-1:b]
|
| 162 |
excursion = (direction * (path[-1, 0]-path[0, 0]) if direction
|
| 163 |
+
else float(np.max(np.linalg.norm(path-path[0], axis=1))))
|
| 164 |
if excursion < .12:
|
| 165 |
continue
|
| 166 |
# Motion without direction is only a generic rep candidate. It never
|
|
|
|
| 173 |
return bursts
|
| 174 |
|
| 175 |
|
| 176 |
+
def motion_direction(motion, dt):
|
| 177 |
+
"""Image direction of the first strong hand stroke, not a camera label."""
|
| 178 |
+
_, relative, magnitude, _, threshold = motion
|
| 179 |
+
strokes = []
|
| 180 |
+
for sign in (-1, 1):
|
| 181 |
+
signed = np.r_[0., sign*np.diff(relative[:, 0])]
|
| 182 |
+
for a, b, peak in candidate_bursts(relative, magnitude, signed, threshold, dt, sign):
|
| 183 |
+
strokes.append((a, sign, magnitude[peak]))
|
| 184 |
+
if not strokes: return None
|
| 185 |
+
strongest = max(stroke[2] for stroke in strokes)
|
| 186 |
+
# Slower loading and isolated pose jumps must not override the drive.
|
| 187 |
+
return min(stroke for stroke in strokes if stroke[2] >= .65*strongest)[1]
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
def split_bursts(motion, dt):
|
| 191 |
+
"""Direction-independent candidates; include the drive and follow-through.
|
| 192 |
+
|
| 193 |
+
A swing often travels out and back, so its net hand displacement can be
|
| 194 |
+
nearly zero. Treat nearby excursions as one candidate rather than counting
|
| 195 |
+
the return of the hands as a second swing. Never merge a pose evidence gap.
|
| 196 |
+
"""
|
| 197 |
+
_, relative, magnitude, _, threshold = motion
|
| 198 |
+
bursts = candidate_bursts(relative, magnitude, magnitude, threshold, dt, None)
|
| 199 |
+
grouped = []
|
| 200 |
+
gap = max(3, min(240, round(.5/dt)))
|
| 201 |
+
for a, b, peak in bursts:
|
| 202 |
+
if grouped and a-grouped[-1][1] <= gap and np.isfinite(relative[grouped[-1][1]:a]).all():
|
| 203 |
+
previous_a, _, previous_peak = grouped[-1]
|
| 204 |
+
strongest = peak if magnitude[peak] > magnitude[previous_peak] else previous_peak
|
| 205 |
+
grouped[-1] = (previous_a, b, strongest)
|
| 206 |
+
else:
|
| 207 |
+
grouped.append((a, b, peak))
|
| 208 |
+
drive = motion_direction(motion, dt)
|
| 209 |
+
if drive is None: return grouped
|
| 210 |
+
directed = candidate_bursts(relative, magnitude,
|
| 211 |
+
np.r_[0., drive*np.diff(relative[:, 0])], threshold, dt, drive)
|
| 212 |
+
# A slow backswing with a long pause can be its own generic motion group.
|
| 213 |
+
# It is preparation, not another rep, when the faster drive goes the other
|
| 214 |
+
# way. Automatic ranges subsequently look back to include that preparation.
|
| 215 |
+
return [group for group in grouped if any(group[0] <= peak < group[1]
|
| 216 |
+
for _, _, peak in directed)]
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
def automatic_ranges(bursts, motion, dt, direction, n, points=None, height=None):
|
| 220 |
+
"""Keep preparation before the drive, including a preceding foot step."""
|
| 221 |
_, relative, magnitude, _, threshold = motion
|
| 222 |
minimum = max(3, min(12, round(.035/dt)))
|
| 223 |
quiet = np.isfinite(magnitude) & (magnitude < threshold*.3)
|
| 224 |
backward = (np.r_[False, direction*np.diff(relative[:, 0]) < -threshold*.6]
|
| 225 |
if direction else np.zeros(n, bool))
|
| 226 |
+
margin = max(minimum+2, min(120, round(.2/dt)))
|
| 227 |
output = []
|
| 228 |
for index, (a, b, peak) in enumerate(bursts):
|
| 229 |
left = 0 if index == 0 else (bursts[index-1][2]+peak)//2+1
|
| 230 |
right = n-1 if index+1 == len(bursts) else (peak+bursts[index+1][2])//2
|
| 231 |
if left > a or right < b-1: continue
|
| 232 |
+
lookback = max(left, a-max(margin, min(600, round(2./dt))))
|
| 233 |
+
if points is not None and height is not None and a-lookback >= minimum:
|
| 234 |
+
hips = (points[:, 11]+points[:, 12])/2
|
| 235 |
+
features = np.stack(((points[:, 9]+points[:, 10])/2-hips,
|
| 236 |
+
points[:, 15]-hips, points[:, 16]-hips), axis=1)/height
|
| 237 |
+
reference = features[lookback:lookback+minimum]
|
| 238 |
+
valid = np.isfinite(reference).all(axis=(1, 2))
|
| 239 |
+
if valid.any():
|
| 240 |
+
baseline = np.median(reference[valid], axis=0)
|
| 241 |
+
departure = np.linalg.norm(features[lookback:a]-baseline, axis=2)
|
| 242 |
+
active = np.any(departure > .025, axis=1) & np.isfinite(departure).all(axis=1)
|
| 243 |
+
preparation = [(s+lookback, e+lookback) for s, e in runs(active) if e-s >= minimum]
|
| 244 |
+
anchor = preparation[0][0] if preparation else a
|
| 245 |
+
start = max(lookback, anchor-margin)
|
| 246 |
+
else:
|
| 247 |
+
start = lookback
|
| 248 |
+
else:
|
| 249 |
+
load_runs = [(s+left, e+left) for s, e in runs(backward[left:a]) if e-s >= minimum]
|
| 250 |
+
anchor = load_runs[-1][0] if load_runs else a
|
| 251 |
+
before = [(s+left, e+left) for s, e in runs(quiet[left:anchor]) if e-s >= minimum]
|
| 252 |
+
start = max(before[-1][0], anchor-margin) if before else left
|
| 253 |
after = [(s+b, e+b) for s, e in runs(quiet[b:right+1]) if e-s >= minimum]
|
| 254 |
end = min(right, after[0][0]+minimum+2) if after else right
|
| 255 |
output.append((start, end))
|
|
|
|
| 271 |
if any(x is None for x in counts):
|
| 272 |
diagnostics.append("Person counts are unavailable for some analyzed frames.")
|
| 273 |
width, video_height = track["video"]["width"], track["video"]["height"]
|
| 274 |
+
kp = point_array(f["kp"], 17)[ids]
|
| 275 |
if present:
|
| 276 |
if np.median([b[3]-b[1] for b in present]) < .18*video_height or (height and height < 120):
|
| 277 |
reasons.append("person_too_small")
|
| 278 |
+
# Detection boxes include loose padding. A box at the image boundary
|
| 279 |
+
# alone is not evidence that the athlete's head/hands/feet were cut off.
|
| 280 |
+
cropped = 0
|
| 281 |
+
for box, joints in zip(boxes, kp):
|
| 282 |
+
if box is None: continue
|
| 283 |
+
edges = (box[0] <= 2, box[1] <= 2, box[2] >= width-2, box[3] >= video_height-2)
|
| 284 |
+
if not any(edges): continue
|
| 285 |
+
critical = joints[[0, 9, 10, 15, 16]]
|
| 286 |
+
missing = not np.isfinite(critical).all()
|
| 287 |
+
x, y = critical[:, 0], critical[:, 1]
|
| 288 |
+
near_edge = ((edges[0] and np.any(x < .01*width)) or
|
| 289 |
+
(edges[2] and np.any(x > .99*width)) or
|
| 290 |
+
(edges[1] and np.any(y < .06*(height or video_height))) or
|
| 291 |
+
(edges[3] and np.any(y > video_height-.04*(height or video_height))))
|
| 292 |
+
cropped += missing or near_edge
|
| 293 |
+
if cropped > .1*len(ids):
|
| 294 |
reasons.append("partly_out_of_frame")
|
| 295 |
jumps = 0
|
| 296 |
for previous, current, a, b in zip(ids, ids[1:], boxes, boxes[1:]):
|
|
|
|
| 300 |
if jumps:
|
| 301 |
reasons.append("player_switched")
|
| 302 |
diagnostics.append("A large adjacent-frame box jump suggests a camera cut or identity change.")
|
|
|
|
| 303 |
core = [0, 5, 6, 11, 12, 15, 16]
|
| 304 |
complete = np.isfinite(kp[:, core]).all(axis=(1, 2))
|
| 305 |
if complete.mean() < .8: reasons.append("low_pose_confidence")
|
|
|
|
| 318 |
diagnostics.append("Capture FPS is unknown or variable; timing metrics are withheld.")
|
| 319 |
if options.view != "face_on": reasons.append("view_uncertain")
|
| 320 |
if options.camera_stability != "fixed_verified":
|
| 321 |
+
diagnostics.append("Camera stability is unverified or moving; ground-foot events and head path are withheld. Within-frame body positions and projected angles do not require a fixed camera.")
|
| 322 |
reasons = list(dict.fromkeys(reasons))
|
| 323 |
return {"ok": not any(r in FATAL_REASONS for r in reasons), "reasons": reasons}, diagnostics
|
| 324 |
|
|
|
|
| 330 |
raw_feet = point_array(track["frames"]["kp_extra"], 6)
|
| 331 |
feet = analysis_points(raw_feet)
|
| 332 |
events, missing = {}, {key: "No sufficient 2D evidence." for key in EVENT_ORDER}
|
|
|
|
|
|
|
| 333 |
if height is None:
|
| 334 |
return events, {key: "Body scale is unavailable." for key in EVENT_ORDER}
|
| 335 |
minimum = max(3, min(12, round(.035 / dt)))
|
| 336 |
+
grouped = split_bursts((hands[start:end+1], relative[start:end+1], magnitude[start:end+1],
|
| 337 |
+
magnitude[start:end+1], threshold), dt)
|
| 338 |
+
if len(grouped) > 1:
|
| 339 |
+
return events, {key: "More than one hand-motion burst in this rep range." for key in EVENT_ORDER}
|
| 340 |
+
positive = (candidate_bursts(relative[start:end+1], magnitude[start:end+1],
|
| 341 |
+
forward[start:end+1], threshold, dt, direction)
|
| 342 |
+
if direction is not None and options.view == "face_on" else grouped)
|
| 343 |
if not positive:
|
| 344 |
return events, missing
|
| 345 |
# A caller-declared range with two clear drives is ambiguous. Never silently
|
| 346 |
# select the best peak and call that range one swing.
|
| 347 |
+
if len(positive) > 1:
|
| 348 |
+
# Within a single grouped swing, later hand returns are follow-through
|
| 349 |
+
# candidates. Use the strongest directed drive, not those later returns.
|
| 350 |
+
positive = [max(positive, key=lambda burst: magnitude[start+burst[2]])]
|
| 351 |
a, b, peak = positive[0]
|
| 352 |
a, b, peak = a+start, b+start, peak+start
|
| 353 |
+
if direction is None or options.view != "face_on":
|
| 354 |
+
# A generic grouped candidate may include the slower hand load. Label
|
| 355 |
+
# onset at sustained rapid motion, not at the start of that preparation.
|
| 356 |
+
speed = median_filter(magnitude[a:b], size=3, mode="nearest")
|
| 357 |
+
active = np.isfinite(speed) & (speed >= max(threshold, .5*np.nanmax(speed)))
|
| 358 |
+
rapid = [(s, e) for s, e in runs(active) if e-s >= minimum]
|
| 359 |
+
if rapid:
|
| 360 |
+
a += rapid[0][0]
|
| 361 |
def add(name, frame, method, note, joints=(9, 10, 11, 12)):
|
| 362 |
if frame < start or frame > end or not np.isfinite(raw[frame, list(joints)]).all():
|
| 363 |
return
|
|
|
|
| 367 |
t = track["frames"]["t_s"][frame]
|
| 368 |
if t is not None: event["t_s"] = float(t)
|
| 369 |
events[name] = event; missing.pop(name, None)
|
| 370 |
+
if direction is not None and options.view == "face_on":
|
| 371 |
add("swing_start", a, "sustained_forward_hand_motion_v1",
|
| 372 |
"Estimated onset of sustained forward hand displacement; acceleration onset is not validated.")
|
| 373 |
else:
|
| 374 |
+
add("swing_start", a, "relative_hand_motion_onset_v2",
|
| 375 |
+
"Hand-motion onset candidate; forward direction and precise swing onset are not established.")
|
| 376 |
quiet = np.isfinite(magnitude) & (magnitude < threshold*.3)
|
| 377 |
quiet_runs = [(s, e) for s, e in runs(quiet[start:a]) if e-s >= minimum]
|
| 378 |
+
finish_start = max(b, start+grouped[0][1]) if grouped else b
|
| 379 |
+
for s, e in runs(quiet[finish_start:end+1]):
|
| 380 |
+
if e-s >= minimum and finish_start+s+minimum-1 < end:
|
| 381 |
+
add("finish", finish_start+s, "post_drive_quiet_hands_v1",
|
| 382 |
+
"Estimated post-swing settling; the last clip frame is not used as finish.")
|
| 383 |
+
break
|
| 384 |
+
if options.view != "face_on":
|
| 385 |
+
if quiet_runs:
|
| 386 |
+
add("stance_set", start+quiet_runs[0][0], "pre_drive_quiet_hands_v1",
|
| 387 |
+
"Stable hands before the motion candidate; complete stance is not confirmed.")
|
| 388 |
+
for key in ("load_start", "stride", "foot_contact", "foot_plant", "contact"):
|
| 389 |
+
missing[key] = "A declared face-on recording is required."
|
| 390 |
+
return events, missing
|
| 391 |
# Last visible backward hand excursion before the forward drive.
|
| 392 |
if direction is not None:
|
| 393 |
+
backward = np.r_[False, direction*np.diff(relative[:, 0]) < -max(.0005, threshold*.15)]
|
| 394 |
loads = []
|
| 395 |
for s, e in runs(backward[start:a]):
|
| 396 |
s, e = s+start, e+start
|
|
|
|
| 405 |
preparation_end = events.get("load_start", {"frame": a})["frame"]
|
| 406 |
quiet_runs = [(s, e) for s, e in quiet_runs if start+e <= preparation_end]
|
| 407 |
if quiet_runs:
|
| 408 |
+
q, stop = quiet_runs[0]
|
| 409 |
add("stance_set", start+q, "pre_drive_quiet_hands_v1",
|
| 410 |
"Stable hands are a stance estimate, not proof of a complete stance.")
|
| 411 |
lead = 0 if options.handedness == "right" else 1 if options.handedness == "left" else None
|
|
|
|
| 431 |
missing["contact"] = "A visible forward lead-arm extension peak was not found."
|
| 432 |
else:
|
| 433 |
missing["contact"] = "Handedness and pitcher direction are required for the contact estimate."
|
| 434 |
+
if options.camera_stability != "fixed_verified":
|
| 435 |
+
for key in ("stride", "foot_contact", "foot_plant"):
|
| 436 |
+
missing[key] = "A fixed camera is required to distinguish ground-foot movement from camera movement."
|
| 437 |
+
elif lead is not None:
|
| 438 |
ankle = 15+lead
|
| 439 |
back_ankle = 16-lead
|
| 440 |
prep_end = events.get("load_start", events.get("swing_start", {"frame": a}))["frame"]
|
|
|
|
| 498 |
else:
|
| 499 |
for key in ("stride", "foot_contact", "foot_plant"):
|
| 500 |
missing[key] = "Handedness is required to identify the lead foot."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
prior = start
|
| 502 |
for key in EVENT_ORDER:
|
| 503 |
if key not in events: continue
|
|
|
|
| 515 |
if not capture["ok"]:
|
| 516 |
reason = "Capture failed: " + ", ".join(capture["reasons"])
|
| 517 |
elif options.view != "face_on": reason = "A declared face-on recording is required."
|
|
|
|
| 518 |
elif height is None: reason = "Body-height scale is unavailable."
|
| 519 |
else: reason = None
|
| 520 |
def frame(name): return events[name]["frame"] if name in events else None
|
| 521 |
plant, contact, stance, load, onset = map(frame, ("foot_plant", "contact", "stance_set", "load_start", "swing_start"))
|
| 522 |
if reason is None and lead is not None:
|
| 523 |
ankle, back = 15+lead, 16-lead
|
| 524 |
+
def lead_agrees(i):
|
| 525 |
+
return (i is not None and direction is not None and
|
| 526 |
+
np.isfinite(points[i, [ankle, back]]).all() and
|
| 527 |
+
direction*(points[i, ankle, 0]-points[i, back, 0]) > .025*height)
|
| 528 |
+
if fixed and plant is not None and lead_agrees(plant):
|
| 529 |
values["stride_pct_height"] = abs(points[plant, ankle, 0]-points[plant, back, 0]) / height*100
|
| 530 |
notes["stride_pct_height"] = scale_note + " Horizontal ankle span at settled-foot proxy; full body-weight loading unmeasured."
|
| 531 |
+
if contact is not None and lead_agrees(contact) and np.isfinite(points[contact, [11, 12, ankle]]).all():
|
| 532 |
hip_x = (points[contact, 11, 0]+points[contact, 12, 0])/2
|
| 533 |
values["com_drift_pct_height"] = direction*(hip_x-points[contact, ankle, 0]) / height*100
|
| 534 |
notes["com_drift_pct_height"] = scale_note + " Hip midpoint relative to front ankle; negative means behind; not whole-body center of mass."
|
| 535 |
+
if contact is not None and lead_agrees(contact):
|
| 536 |
hip, knee = (11, 13) if lead == 0 else (12, 14)
|
| 537 |
values["lead_knee_angle_contact_deg"] = included_angle(points[contact, hip], points[contact, knee], points[contact, ankle])
|
| 538 |
notes["lead_knee_angle_contact_deg"] = "Reference only: projected interior knee angle at estimated contact; face-on projection does not measure anatomical flexion."
|
| 539 |
+
if contact is not None and not lead_agrees(contact):
|
| 540 |
+
for key in ("com_drift_pct_height", "lead_knee_angle_contact_deg"):
|
| 541 |
+
notes[key] = "Lead-leg geometry is ambiguous or conflicts with handedness/pitcher direction; check those inputs."
|
| 542 |
+
if plant is not None and not lead_agrees(plant):
|
| 543 |
+
notes["stride_pct_height"] = "Lead-leg geometry is ambiguous or conflicts with handedness/pitcher direction; check those inputs."
|
| 544 |
fps = track["video"]["capture_fps"]
|
| 545 |
timing_reason = ("Real capture timing is unknown or variable." if fps is None else
|
| 546 |
"Timing measurements require real capture FPS >= 60." if fps < 60-1e-6 else None)
|
|
|
|
| 556 |
if contact is not None and real_times[contact] > real_times[onset]:
|
| 557 |
values["load_launch_ratio"] = duration / (real_times[contact]-real_times[onset])
|
| 558 |
notes["load_launch_ratio"] = "Estimated load duration divided by forward onset-to-contact duration."
|
| 559 |
+
if reason is None and fixed and stance is not None and contact is not None:
|
| 560 |
+
nose = analysis_points(point_array(track["frames"]["kp"], 17))[stance:contact+1, 0]
|
| 561 |
if len(nose) >= 2 and np.isfinite(nose).all():
|
| 562 |
values["head_movement_pct_height"] = np.linalg.norm(np.diff(nose, axis=0), axis=1).sum() / height*100
|
| 563 |
notes["head_movement_pct_height"] = scale_note + " Reference-only smoothed nose path from stance to estimated contact; not calibrated for judging."
|
| 564 |
missing = {
|
| 565 |
+
"stride_pct_height": ("A fixed camera is required for the foot-plant estimate." if not fixed else
|
| 566 |
+
"Lead-foot identity, body scale or estimated foot plant is missing."),
|
| 567 |
"com_drift_pct_height": "Lead-foot identity, pitcher direction or estimated contact is missing.",
|
| 568 |
"foot_plant_to_contact_ms": timing_reason or "Estimated foot plant or contact is missing.",
|
| 569 |
"load_tempo_s": timing_reason or "Load start or forward swing onset is missing.",
|
| 570 |
"load_launch_ratio": timing_reason or "Load start, forward swing onset or contact is missing.",
|
| 571 |
+
"head_movement_pct_height": ("A fixed camera is required; camera movement would contaminate the head path." if not fixed else
|
| 572 |
+
"Stance, estimated contact or a contiguous head path is missing."),
|
| 573 |
"lead_knee_angle_contact_deg": "Lead-leg identity or estimated contact is missing.",
|
| 574 |
"lateral_trunk_tilt_contact_deg": "Unavailable: face-on 2D cannot establish the requested anatomical trunk tilt.",
|
| 575 |
"hip_shoulder_separation_foot_plant_deg": "Unavailable: image-plane line angles do not measure axial hip-shoulder twist.",
|
|
|
|
| 588 |
|
| 589 |
def analyze_batting(track, options):
|
| 590 |
raw = point_array(track["frames"]["kp"], 17)
|
| 591 |
+
points = analysis_body_points(raw)
|
| 592 |
height, height_method = stature(points, options)
|
| 593 |
if height is not None and height > 2*math.hypot(track["video"]["width"], track["video"]["height"]):
|
| 594 |
height, height_method = None, "body-height scale exceeds the image geometry"
|
|
|
|
|
|
|
| 595 |
_, dt = motion_clock(track["frames"])
|
| 596 |
+
direction = direction_from_stance(points, options, height, dt)
|
| 597 |
+
motion = hand_motion(points, height, direction)
|
| 598 |
n = len(raw)
|
| 599 |
declared = [(r.start_frame, r.end_frame) for r in options.reps]
|
| 600 |
if options.single_swing: declared = [(0, n-1)]
|
|
|
|
| 602 |
ranges = declared
|
| 603 |
boundary_method = "caller_declared_single_swing" if options.single_swing else "caller_supplied"
|
| 604 |
elif height is not None:
|
| 605 |
+
bursts = split_bursts(motion, dt)
|
| 606 |
+
ranges = automatic_ranges(bursts, motion, dt, direction, n, points, height)
|
| 607 |
boundary_method = "automatic_2d_hand_motion_candidate"
|
| 608 |
else:
|
| 609 |
ranges = []; boundary_method = "automatic_2d_hand_motion_candidate"
|
|
|
|
| 631 |
warnings = ["All event detections and non-null swing measurements are unvalidated 2D estimates.",
|
| 632 |
"Foot plant is a settled-foot proxy; full body-weight loading is not measured.",
|
| 633 |
"Contact is a lead-arm extension estimate; no bat-ball collision is confirmed."] + diagnostics + limit_warning
|
| 634 |
+
if direction is None:
|
| 635 |
+
warnings.append("Pitcher direction is ambiguous or conflicts with ankle ordering. Check handedness and supply pitcher_direction when known; swing splitting does not use this guess.")
|
| 636 |
if not ranges: warnings.append("No separable swing candidates found; no rep or measurements fabricated.")
|
| 637 |
return pose_reps, measurement_reps, capture, warnings, {
|
| 638 |
"version": VERSION, "body_height_px": height, "body_height_method": height_method,
|
| 639 |
"pitcher_direction": "image_right" if direction == 1 else "image_left" if direction == -1 else None,
|
| 640 |
+
"processing": ["interior_gap_fill_max_3_frames", "hip_relative_3_frame_median",
|
| 641 |
+
"absolute_3_frame_median_for_fixed_camera_head_path", "raw_pose_track_unchanged"],
|
| 642 |
"validation": "reference_validation_pending"}
|
| 643 |
|
| 644 |
|
baseball_batting/body2d.py
CHANGED
|
@@ -2,6 +2,21 @@ from pathlib import Path
|
|
| 2 |
import numpy as np
|
| 3 |
from .detection import ort_session, verify_cuda_nodes
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
class RTMWPose:
|
| 6 |
def __init__(self, path, device="cpu"):
|
| 7 |
if not Path(path).is_file() or Path(path).suffix != ".onnx":
|
|
@@ -30,4 +45,4 @@ class RTMWPose:
|
|
| 30 |
self.cuda_verified = True
|
| 31 |
if points.shape != (133, 2) or scores.shape != (133,):
|
| 32 |
raise ValueError("RTMW must preserve 133-point native topology")
|
| 33 |
-
return points, scores
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
from .detection import ort_session, verify_cuda_nodes
|
| 4 |
|
| 5 |
+
|
| 6 |
+
def filter_implausible_feet(points, scores):
|
| 7 |
+
"""Reject detached toe/heel predictions; never move them onto an ankle."""
|
| 8 |
+
points, scores = points.copy(), scores.copy()
|
| 9 |
+
for knee, ankle, feet in ((13, 15, range(17, 20)), (14, 16, range(20, 23))):
|
| 10 |
+
if not np.isfinite(points[[knee, ankle]]).all():
|
| 11 |
+
points[list(feet)], scores[list(feet)] = np.nan, 0.
|
| 12 |
+
continue
|
| 13 |
+
limit = max(30., .75 * np.linalg.norm(points[knee]-points[ankle]))
|
| 14 |
+
for joint in feet:
|
| 15 |
+
if not np.isfinite(points[joint]).all() or np.linalg.norm(points[joint]-points[ankle]) > limit:
|
| 16 |
+
points[joint], scores[joint] = np.nan, 0.
|
| 17 |
+
return points, scores
|
| 18 |
+
|
| 19 |
+
|
| 20 |
class RTMWPose:
|
| 21 |
def __init__(self, path, device="cpu"):
|
| 22 |
if not Path(path).is_file() or Path(path).suffix != ".onnx":
|
|
|
|
| 45 |
self.cuda_verified = True
|
| 46 |
if points.shape != (133, 2) or scores.shape != (133,):
|
| 47 |
raise ValueError("RTMW must preserve 133-point native topology")
|
| 48 |
+
return filter_implausible_feet(points, scores)
|
baseball_batting/detection.py
CHANGED
|
@@ -119,3 +119,19 @@ def select_person(detections, previous=None):
|
|
| 119 |
return None # Do not silently jump to a different person.
|
| 120 |
return candidates[int(np.argmax(overlaps))]
|
| 121 |
return max(candidates, key=lambda d: max(0, d["box"][2]-d["box"][0]) * max(0, d["box"][3]-d["box"][1]) * d["score"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
return None # Do not silently jump to a different person.
|
| 120 |
return candidates[int(np.argmax(overlaps))]
|
| 121 |
return max(candidates, key=lambda d: max(0, d["box"][2]-d["box"][0]) * max(0, d["box"][3]-d["box"][1]) * d["score"])
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def relevant_people(detections, selected, image_height):
|
| 125 |
+
"""Count athlete-sized person proposals, excluding tiny background hits.
|
| 126 |
+
|
| 127 |
+
The tracked athlete always counts, including a small/poor recording. The
|
| 128 |
+
capture check rejects it separately when too small. This count is a detector
|
| 129 |
+
heuristic, not proof that all background people have been identified.
|
| 130 |
+
"""
|
| 131 |
+
if selected is None:
|
| 132 |
+
return sum(d["class_id"] == 0 for d in detections)
|
| 133 |
+
selected_height = selected["box"][3]-selected["box"][1]
|
| 134 |
+
minimum = max(.15*image_height, .35*selected_height)
|
| 135 |
+
return sum(d["class_id"] == 0 and
|
| 136 |
+
(d is selected or d["box"][3]-d["box"][1] >= minimum)
|
| 137 |
+
for d in detections)
|
baseball_batting/observations.py
CHANGED
|
@@ -5,7 +5,7 @@ from .annotations import load_annotations
|
|
| 5 |
from .bat2d import BatTracker
|
| 6 |
from .body2d import RTMWPose
|
| 7 |
from .contracts import RTMW_CORE
|
| 8 |
-
from .detection import YOLOXDetector, select_person
|
| 9 |
from .ingest import iter_frames
|
| 10 |
from .objects import BallTracker, possible_impact_reset
|
| 11 |
from .storage import StageCache, atomic_json, read_json
|
|
@@ -111,9 +111,9 @@ def run_observations(video, capture, config, cache, progress=None):
|
|
| 111 |
else:
|
| 112 |
try:
|
| 113 |
candidates = person(image) if person else proposals
|
| 114 |
-
if person or objects:
|
| 115 |
-
people_count = sum(d["class_id"] == 0 for d in candidates)
|
| 116 |
selected = select_person(candidates, state["person_box"])
|
|
|
|
|
|
|
| 117 |
except Exception as e:
|
| 118 |
errors["person_detector"] = {"status": "failed", "reason": str(e)[:300]}
|
| 119 |
person = None
|
|
|
|
| 5 |
from .bat2d import BatTracker
|
| 6 |
from .body2d import RTMWPose
|
| 7 |
from .contracts import RTMW_CORE
|
| 8 |
+
from .detection import YOLOXDetector, select_person, relevant_people
|
| 9 |
from .ingest import iter_frames
|
| 10 |
from .objects import BallTracker, possible_impact_reset
|
| 11 |
from .storage import StageCache, atomic_json, read_json
|
|
|
|
| 111 |
else:
|
| 112 |
try:
|
| 113 |
candidates = person(image) if person else proposals
|
|
|
|
|
|
|
| 114 |
selected = select_person(candidates, state["person_box"])
|
| 115 |
+
if person or objects:
|
| 116 |
+
people_count = relevant_people(candidates, selected, image.shape[0])
|
| 117 |
except Exception as e:
|
| 118 |
errors["person_detector"] = {"status": "failed", "reason": str(e)[:300]}
|
| 119 |
person = None
|
configs/resources.yaml
CHANGED
|
@@ -24,9 +24,12 @@ resources:
|
|
| 24 |
intended_role: explicit RTMW pose adapter
|
| 25 |
body_pose:
|
| 26 |
type: checkpoint
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
| 30 |
intended_role: native 133-landmark body observations
|
| 31 |
dependency_ids: [rtmlib]
|
| 32 |
person_detector:
|
|
|
|
| 24 |
intended_role: explicit RTMW pose adapter
|
| 25 |
body_pose:
|
| 26 |
type: checkpoint
|
| 27 |
+
# The September cocktail13 checkpoint had a training-label bug that put
|
| 28 |
+
# toe predictions on the head/neck: open-mmlab/mmpose#2771.
|
| 29 |
+
sha256: bd033156e5104c4f5d2edfe0453e02661e30a2f3da453ec93c8764d561b83054
|
| 30 |
+
archive_sha256: a87e1af41a0a067776dba7d46e1c21c8f6e9f18e247e0e606718dd1f31e96ffd
|
| 31 |
+
source_url: https://download.openmmlab.com/mmpose/v1/projects/rtmw/onnx_sdk/rtmw-dw-x-l_simcc-cocktail14_270e-384x288_20231122.zip
|
| 32 |
+
version: rtmw-dw-x-l-20231122
|
| 33 |
intended_role: native 133-landmark body observations
|
| 34 |
dependency_ids: [rtmlib]
|
| 35 |
person_detector:
|
docs/API_FOR_COACH.md
CHANGED
|
@@ -28,7 +28,7 @@ curl -X POST https://your-engine-hostname/v1/analyses \
|
|
| 28 |
-F 'options={"view":"face_on","handedness":"right","level":"hs_varsity","camera_stability":"fixed_verified","timing":{"kind":"unretimed","source":"original camera recording; no retiming"}}'
|
| 29 |
```
|
| 30 |
|
| 31 |
-
Declare view, camera stability and timing only when known. `fixed_verified` means the camera stays still.
|
| 32 |
|
| 33 |
HTTP 202 returns `job_id`, `status_url`, `result_url` and `coach_payload_url`. Poll `status_url` every 2–5 seconds. Once `status` is `completed`, download `coach_payload_url` into `session.json`, then send that file to your friend's API:
|
| 34 |
|
|
@@ -70,7 +70,7 @@ An example computed from constructed trajectories is in [coach-payload.example.j
|
|
| 70 |
| `handedness` | `left` or `right`; identifies lead arm/foot |
|
| 71 |
| `level` | Optional `hs_jv`, `hs_varsity` or `college`; forwarded without assumption |
|
| 72 |
| `camera_stability` | `unknown`, `fixed_verified`, or `moving` |
|
| 73 |
-
| `pitcher_direction` | Optional `image_left` / `image_right`; otherwise
|
| 74 |
| `body_height_px` + `body_height_source` | Optional known standing image height and its source, in upright pixels; real height in meters alone is not camera calibration |
|
| 75 |
| `rotation_degrees` | Optional clockwise 0/90/180/270 override |
|
| 76 |
| `timing` | Capture-clock declaration, below; defaults to unknown |
|
|
|
|
| 28 |
-F 'options={"view":"face_on","handedness":"right","level":"hs_varsity","camera_stability":"fixed_verified","timing":{"kind":"unretimed","source":"original camera recording; no retiming"}}'
|
| 29 |
```
|
| 30 |
|
| 31 |
+
Declare view, camera stability and timing only when known. `fixed_verified` means the camera stays still. Unknown view withholds technique measurements but still permits generic motion events at video frames. With a known face-on view, moving/unknown cameras can return within-frame body positions and projected knee-angle estimates when the required events are found; ground-foot events and head paths remain withheld. Supply `single_swing:true` when the entire clip is known to contain exactly one swing; otherwise automatic candidate splitting runs. You can alternatively supply rep ranges.
|
| 32 |
|
| 33 |
HTTP 202 returns `job_id`, `status_url`, `result_url` and `coach_payload_url`. Poll `status_url` every 2–5 seconds. Once `status` is `completed`, download `coach_payload_url` into `session.json`, then send that file to your friend's API:
|
| 34 |
|
|
|
|
| 70 |
| `handedness` | `left` or `right`; identifies lead arm/foot |
|
| 71 |
| `level` | Optional `hs_jv`, `hs_varsity` or `college`; forwarded without assumption |
|
| 72 |
| `camera_stability` | `unknown`, `fixed_verified`, or `moving` |
|
| 73 |
+
| `pitcher_direction` | Optional `image_left` / `image_right` toward pitcher/tee; otherwise ankle ordering must agree with strong hand motion. Conflicts leave direction unknown. |
|
| 74 |
| `body_height_px` + `body_height_source` | Optional known standing image height and its source, in upright pixels; real height in meters alone is not camera calibration |
|
| 75 |
| `rotation_degrees` | Optional clockwise 0/90/180/270 override |
|
| 76 |
| `timing` | Capture-clock declaration, below; defaults to unknown |
|
docs/BATTING_2D_MEASUREMENTS.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
| 1 |
# 2D batting measurement definitions
|
| 2 |
|
| 3 |
-
Version: `batting-2d-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
## Reliability
|
| 6 |
|
| 7 |
All event detections and non-null metric values are estimates pending independent validation. Synthetic numerical checks validate arithmetic and abstention rules; they do not demonstrate accuracy on baseball videos. The event confidence number is capped at 0.5 and bounded by the supporting pose scores; it is a heuristic score, not a calibrated probability. No `high`/`medium` metric label is emitted.
|
| 8 |
|
| 9 |
-
Raw points remain unchanged in `pose_track`. For calculations, only interior missing runs of at most three frames are interpolated. A three-frame median is applied to contiguous finite runs. Longer gaps remain missing, and a detected event needs raw supporting joints at that frame.
|
| 10 |
|
| 11 |
## Scale and direction
|
| 12 |
|
|
@@ -14,18 +20,20 @@ A caller can provide a known standing image height in upright pixels with a sour
|
|
| 14 |
|
| 15 |
The fallback is the 90th percentile of `1.08 × (nose-to-midshoulder length + midshoulder-to-midhip length + mean hip-knee-ankle chain length)`. The 1.08 correction for missing head/foot extent is a declared heuristic, not a validated anthropometric calibration. This projected skeleton estimate can be biased by foreshortening and posture; percentage metrics remain `est` and carry a scale note.
|
| 16 |
|
| 17 |
-
For right-handed hitters the left arm/foot leads; for left-handed hitters the right arm/foot leads. Pitcher direction may be supplied as image left/right. Otherwise it is the sign of median lead-minus-back ankle x, only when separation exceeds 4% of estimated height.
|
| 18 |
|
| 19 |
## Swings and events
|
| 20 |
|
| 21 |
-
Automatic splitting
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
| Event | Evidence and limitation |
|
| 26 |
|---|---|
|
| 27 |
| `stance_set` | Quiet hands before loading/drive; estimated stance |
|
| 28 |
-
| `load_start` | Sustained backward hand excursion before forward motion |
|
| 29 |
| `stride` | Lead ankle departs preparation position by >2.5% of height |
|
| 30 |
| `foot_contact` | After a clear lift, toe/heel returns near preparation ground level; estimated touchdown |
|
| 31 |
| `foot_plant` | Displaced lead ankle settles near preparation ground level; does **not** measure full body-weight loading |
|
|
@@ -40,12 +48,12 @@ Events must be inside their rep and follow the requested order. Conflicting cand
|
|
| 40 |
| Key | Formula | Additional gate |
|
| 41 |
|---|---|---|
|
| 42 |
| `stride_pct_height` | `100 × abs(lead_ankle_x - back_ankle_x) / image_height_scale` at estimated foot plant | Lead side, plant and scale |
|
| 43 |
-
| `com_drift_pct_height` | `100 × pitcher_direction × (hip_midpoint_x - lead_ankle_x) / scale` at estimated contact | Negative is behind; hip proxy, not whole-body center of mass |
|
| 44 |
| `foot_plant_to_contact_ms` | Physical contact time minus physical plant time, ×1000 | Both events; constant capture FPS >=60 |
|
| 45 |
| `load_tempo_s` | Physical forward-onset time minus physical hand-load-start time | Both events; constant capture FPS >=60 |
|
| 46 |
| `load_launch_ratio` | Load duration / physical onset-to-contact duration | All events; positive denominator; constant capture FPS >=60 |
|
| 47 |
-
| `head_movement_pct_height` | Sum of consecutive analytical nose displacements from stance to estimated contact, /scale ×100 |
|
| 48 |
-
| `lead_knee_angle_contact_deg` | Interior projected hip-knee-ankle angle at estimated contact | Reference-only; not anatomical 3D flexion |
|
| 49 |
| `lateral_trunk_tilt_contact_deg` | Null | Requested anatomical tilt not established by face-on 2D |
|
| 50 |
| `hip_shoulder_separation_foot_plant_deg` | Null | Image-plane segment angles do not measure axial twist |
|
| 51 |
|
|
@@ -53,9 +61,15 @@ The load-duration/ratio definitions above are explicit implementation convention
|
|
| 53 |
|
| 54 |
## Capture checks
|
| 55 |
|
| 56 |
-
Quality is checked over the selected rep ranges, or the complete clip when no candidates exist. Only the friend's recognized capture reason keys are returned.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
## Validation remaining
|
| 61 |
|
|
|
|
| 1 |
# 2D batting measurement definitions
|
| 2 |
|
| 3 |
+
Version: `batting-2d-v2`. Scope: face-on batting, with fixed-camera requirements only for ground-foot events and head movement. This module uses GPU pose/person outputs and CPU arithmetic, with no SAM, temporal 3D fitting, OpenSim or coaching decisions.
|
| 4 |
+
|
| 5 |
+
## Pose checkpoint and foot points
|
| 6 |
+
|
| 7 |
+
The pinned pose artifact is `rtmw-dw-x-l_simcc-cocktail14_270e-384x288_20231122`. It replaces the September cocktail13 checkpoint, whose toe outputs suffered from the upstream [foot/head training-label bug](https://github.com/open-mmlab/mmpose/issues/2771). Both archive and extracted ONNX hashes are pinned. Existing Colab model caches are replaced when their source/hash differs.
|
| 8 |
+
|
| 9 |
+
Toe/heel predictions farther from their ankle than `max(30 px, 0.75 × projected knee-to-ankle length)` are unavailable. An unknown knee/ankle also withholds its foot points. The guard does not invent replacement points or move them to the ankle. Foot points are drawn in orange in the Colab previews so these errors can be inspected.
|
| 10 |
|
| 11 |
## Reliability
|
| 12 |
|
| 13 |
All event detections and non-null metric values are estimates pending independent validation. Synthetic numerical checks validate arithmetic and abstention rules; they do not demonstrate accuracy on baseball videos. The event confidence number is capped at 0.5 and bounded by the supporting pose scores; it is a heuristic score, not a calibrated probability. No `high`/`medium` metric label is emitted.
|
| 14 |
|
| 15 |
+
Raw points remain unchanged in `pose_track`. For calculations, only interior missing runs of at most three frames are interpolated. A three-frame median is applied to contiguous finite runs of hip-relative body geometry before restoring the image position. This prevents a translating camera from changing the filtering of relative-hand events. Longer gaps remain missing, and a detected event needs raw supporting joints at that frame. Fixed-camera nose paths use a separate absolute-image three-frame median; smoothing affects their value.
|
| 16 |
|
| 17 |
## Scale and direction
|
| 18 |
|
|
|
|
| 20 |
|
| 21 |
The fallback is the 90th percentile of `1.08 × (nose-to-midshoulder length + midshoulder-to-midhip length + mean hip-knee-ankle chain length)`. The 1.08 correction for missing head/foot extent is a declared heuristic, not a validated anthropometric calibration. This projected skeleton estimate can be biased by foreshortening and posture; percentage metrics remain `est` and carry a scale note.
|
| 22 |
|
| 23 |
+
For right-handed hitters the left arm/foot leads; for left-handed hitters the right arm/foot leads. Pitcher direction may be supplied as image left/right. Otherwise it is the sign of median lead-minus-back ankle x, only when separation exceeds 4% of estimated height and it agrees with the first strong sustained hand stroke. Contradictions leave direction unknown and produce a warning; the engine never silently changes handedness. A supplied direction is an input declaration. At plant/contact, lead-leg metrics are still withheld if the declared lead ankle lies behind the other ankle or their separation is ambiguous.
|
| 24 |
|
| 25 |
## Swings and events
|
| 26 |
|
| 27 |
+
Automatic splitting uses hand motion relative to the hip midpoint, independently of handedness and ankle ordering. The adaptive motion threshold uses median motion plus twice its median absolute deviation, with a 30%-of-90th-percentile floor. A generic burst requires a maximum excursion of at least 12% of height, including movements that travel out and back with little net displacement. Excursions separated by at most 0.5 seconds on the available analysis clock are grouped into one candidate; missing hand evidence cannot be bridged. Strong stroke direction helps exclude an isolated slower backwards load from the rep count; it does not establish camera view or handedness.
|
| 28 |
+
|
| 29 |
+
Inter-drive midpoints prevent overlap. Up to two seconds on the analysis clock are inspected before the drive for preparation involving hands or either ankle relative to the hips. Boundaries retain that preparation with a margin instead of starting after the step. Quiet intervals trim trailing footage only after the grouped follow-through. At most 100 candidates are analyzed, with a warning if more were found. These are candidate boundaries, not qualified repetition labels. Caller-declared single-swing/range options remain available. A declared range with several separate grouped swings is ambiguous and produces no forced events.
|
| 30 |
|
| 31 |
+
With an unknown view, only generic stance/hand-motion onset/finish candidates can be returned as frame indices. Technique measurements remain null and `capture` contains `view_uncertain`. Physical event times are never filled from playback time. With a known face-on view and a moving/unverified camera, relative-hand events and within-frame contact proxies remain eligible, while stride/ground-foot events are withheld. Finish needs settling after the whole grouped hand movement; a brief follow-through pause is insufficient.
|
| 32 |
|
| 33 |
| Event | Evidence and limitation |
|
| 34 |
|---|---|
|
| 35 |
| `stance_set` | Quiet hands before loading/drive; estimated stance |
|
| 36 |
+
| `load_start` | Sustained backward hand excursion before forward motion, using a lower threshold than the faster drive |
|
| 37 |
| `stride` | Lead ankle departs preparation position by >2.5% of height |
|
| 38 |
| `foot_contact` | After a clear lift, toe/heel returns near preparation ground level; estimated touchdown |
|
| 39 |
| `foot_plant` | Displaced lead ankle settles near preparation ground level; does **not** measure full body-weight loading |
|
|
|
|
| 48 |
| Key | Formula | Additional gate |
|
| 49 |
|---|---|---|
|
| 50 |
| `stride_pct_height` | `100 × abs(lead_ankle_x - back_ankle_x) / image_height_scale` at estimated foot plant | Lead side, plant and scale |
|
| 51 |
+
| `com_drift_pct_height` | `100 × pitcher_direction × (hip_midpoint_x - lead_ankle_x) / scale` at estimated contact | Negative is behind; hip proxy, not whole-body center of mass; same-frame estimate eligible with a moving camera |
|
| 52 |
| `foot_plant_to_contact_ms` | Physical contact time minus physical plant time, ×1000 | Both events; constant capture FPS >=60 |
|
| 53 |
| `load_tempo_s` | Physical forward-onset time minus physical hand-load-start time | Both events; constant capture FPS >=60 |
|
| 54 |
| `load_launch_ratio` | Load duration / physical onset-to-contact duration | All events; positive denominator; constant capture FPS >=60 |
|
| 55 |
+
| `head_movement_pct_height` | Sum of consecutive analytical nose displacements from stance to estimated contact, /scale ×100 | Fixed camera, complete analytical path; reference-only |
|
| 56 |
+
| `lead_knee_angle_contact_deg` | Interior projected hip-knee-ankle angle at estimated contact | Reference-only; not anatomical 3D flexion; eligible with a moving camera |
|
| 57 |
| `lateral_trunk_tilt_contact_deg` | Null | Requested anatomical tilt not established by face-on 2D |
|
| 58 |
| `hip_shoulder_separation_foot_plant_deg` | Null | Image-plane segment angles do not measure axial twist |
|
| 59 |
|
|
|
|
| 61 |
|
| 62 |
## Capture checks
|
| 63 |
|
| 64 |
+
Quality is checked over the selected rep ranges, or the complete clip when no candidates exist. Only the friend's recognized capture reason keys are returned. Person counts include the tracked athlete and secondary proposals at least `max(15% image height, 35% athlete height)` tall. Tiny background detections do not automatically reject the recording. A second athlete-sized person in >10% of analyzed frames still rejects it. This is a geometric detector heuristic, not a verified census of distant background people.
|
| 65 |
+
|
| 66 |
+
A padded detection box touching an image boundary is insufficient to claim cropping. It must also have missing critical head/hand/ankle points or corresponding points near that boundary. The checks also flag a large adjacent-frame box jump, a small athlete, insufficient full core joints, darkness, blur, low physical FPS and uncertain view. Mild reasons may accompany `ok:true`; fatal reasons set `ok:false` and withhold that rep's numbers.
|
| 67 |
+
|
| 68 |
+
Blur is the existing uncalibrated `1/(1+Laplacian variance/100)` heuristic. Pose responses are clipped to 0–1 for export and are not calibrated probabilities; response scales can differ between checkpoints. Person counts/boxes do not establish athlete identity or visibility. Camera stability and view are caller declarations; the API does not silently claim a validated automatic angle/stability classifier. Unknown counts or recording timing are explained in full-result warnings. Moving/unverified cameras suppress ground-foot events and head paths, not every same-frame quantity.
|
| 69 |
+
|
| 70 |
+
## Run regression checks
|
| 71 |
|
| 72 |
+
`tests/fixtures/walkthrough_pose.json` contains only numeric observations from the corrected model on the supplied walkthrough recording. It has no reference accuracy labels or video pixels. Tests check that this example keeps its preparation/follow-through, avoids the two false capture failures, exports plausible foot locations, withholds conflicting lead-leg measurements, and keeps unknown physical timestamps null. Constructed multi-swing trajectories separately check rep counting and arithmetic. Local CPU replay tests the common 2D code; the updated ONNX checkpoint still needs a fresh target-GPU preflight/run in Colab.
|
| 73 |
|
| 74 |
## Validation remaining
|
| 75 |
|
docs/api-result.schema.json
CHANGED
|
@@ -629,7 +629,7 @@
|
|
| 629 |
],
|
| 630 |
"properties": {
|
| 631 |
"version": {
|
| 632 |
-
"
|
| 633 |
},
|
| 634 |
"body_height_px": {
|
| 635 |
"type": [
|
|
|
|
| 629 |
],
|
| 630 |
"properties": {
|
| 631 |
"version": {
|
| 632 |
+
"enum": ["batting-2d-v1", "batting-2d-v2"]
|
| 633 |
},
|
| 634 |
"body_height_px": {
|
| 635 |
"type": [
|
notebooks/batting_2d_test.ipynb
CHANGED
|
@@ -236,7 +236,9 @@
|
|
| 236 |
"source": [
|
| 237 |
"## 4. Upload a video and set its recording information\n",
|
| 238 |
"\n",
|
| 239 |
-
"You can enter an existing `VIDEO_PATH` or leave it empty to upload. `HANDEDNESS`
|
|
|
|
|
|
|
| 240 |
"\n",
|
| 241 |
"Keep `TIMING={\"kind\":\"unknown\"}` unless capture timing is known. For an original unretimed recording use `{\"kind\":\"unretimed\",\"source\":\"original camera file; no retiming\"}`. For documented constant slow motion use `{\"kind\":\"constant_slowdown\",\"source\":\"documented camera/export settings\",\"factor\":8,\"all_captured_frames_retained\":True}` with the real factor. Playback FPS is not capture FPS. Timing numbers require a known constant capture rate of at least 60 FPS.\n",
|
| 242 |
"\n",
|
|
@@ -253,7 +255,8 @@
|
|
| 253 |
"import uuid\n",
|
| 254 |
"\n",
|
| 255 |
"VIDEO_PATH = \"\" # Or, for example: \"/content/IMG_1640.mp4\"\n",
|
| 256 |
-
"HANDEDNESS =
|
|
|
|
| 257 |
"VIEW = \"unknown\" # Change to \"face_on\" when known.\n",
|
| 258 |
"CAMERA_STABILITY = \"unknown\" # Change to \"fixed_verified\" when the camera stays still.\n",
|
| 259 |
"TIMING = {\"kind\": \"unknown\"}\n",
|
|
@@ -270,6 +273,7 @@
|
|
| 270 |
"if not source_video.is_file():\n",
|
| 271 |
" raise ValueError(\"VIDEO_PATH does not exist. Upload the video or correct its path.\")\n",
|
| 272 |
"OPTIONS = {\"discipline\": \"hitting\", \"handedness\": HANDEDNESS, \"view\": VIEW,\n",
|
|
|
|
| 273 |
" \"camera_stability\": CAMERA_STABILITY, \"timing\": TIMING, \"single_swing\": SINGLE_SWING}\n",
|
| 274 |
"JOB_ROOT = WORKSPACE_ROOT / \"results\" / (\"session-\" + uuid.uuid4().hex[:12])\n",
|
| 275 |
"JOB_ROOT.mkdir(parents=True)\n",
|
|
@@ -385,6 +389,9 @@
|
|
| 385 |
" position(rep[\"end_frame\"]), rep[\"boundary_method\"]] for rep in track[\"reps\"]])\n",
|
| 386 |
"for rep in result[\"measurements\"][\"reps\"][:10]:\n",
|
| 387 |
" print(\"Swing\", rep[\"rep\"], \"| estimated physical events_ms:\", rep[\"events_ms\"])\n",
|
|
|
|
|
|
|
|
|
|
| 388 |
" table([\"Measurement\", \"Value\", \"Unit\", \"Confidence\", \"Explanation\"],\n",
|
| 389 |
" [[m[\"key\"], m[\"value\"], m[\"unit\"], m[\"confidence\"], m[\"note\"]] for m in rep[\"metrics\"]])\n",
|
| 390 |
"print(\"Coach JSON:\", JOB_ROOT / \"coach-payload.json\")\n"
|
|
@@ -399,7 +406,7 @@
|
|
| 399 |
"source": [
|
| 400 |
"## 7. Watch previews of the detected swings\n",
|
| 401 |
"\n",
|
| 402 |
-
"These inspection clips show
|
| 403 |
"\n",
|
| 404 |
"The default limit is ten clips; increase it up to 100 if needed. Inspect each range for missed preparation, truncated finish, merged swings or unrelated movements.\n"
|
| 405 |
],
|
|
|
|
| 236 |
"source": [
|
| 237 |
"## 4. Upload a video and set its recording information\n",
|
| 238 |
"\n",
|
| 239 |
+
"You can enter an existing `VIDEO_PATH` or leave it empty to upload. Set `HANDEDNESS` to the batter's own handedness when known. `PITCHER_DIRECTION` is the direction toward the pitcher/tee in the image: `\"image_left\"` or `\"image_right\"`. Leave it `None` if unknown. Cross-step drills can confuse automatic ankle ordering, so an explicit known direction helps.\n",
|
| 240 |
+
"\n",
|
| 241 |
+
"Set `VIEW=\"face_on\"` only for a known face-on recording. Unknown view keeps measurements empty, while ranges and generic motion events can still be inspected. Set `CAMERA_STABILITY=\"moving\"` for a moving camera and `\"fixed_verified\"` only when the camera stays still. Moving/unknown cameras can still return within-frame body positions and projected knee angles when the required events are found. Ground-foot events and head movement require a fixed camera.\n",
|
| 242 |
"\n",
|
| 243 |
"Keep `TIMING={\"kind\":\"unknown\"}` unless capture timing is known. For an original unretimed recording use `{\"kind\":\"unretimed\",\"source\":\"original camera file; no retiming\"}`. For documented constant slow motion use `{\"kind\":\"constant_slowdown\",\"source\":\"documented camera/export settings\",\"factor\":8,\"all_captured_frames_retained\":True}` with the real factor. Playback FPS is not capture FPS. Timing numbers require a known constant capture rate of at least 60 FPS.\n",
|
| 244 |
"\n",
|
|
|
|
| 255 |
"import uuid\n",
|
| 256 |
"\n",
|
| 257 |
"VIDEO_PATH = \"\" # Or, for example: \"/content/IMG_1640.mp4\"\n",
|
| 258 |
+
"HANDEDNESS = None # Set to \"right\" or \"left\" when known.\n",
|
| 259 |
+
"PITCHER_DIRECTION = None # \"image_left\" or \"image_right\" toward the pitcher/tee, when known.\n",
|
| 260 |
"VIEW = \"unknown\" # Change to \"face_on\" when known.\n",
|
| 261 |
"CAMERA_STABILITY = \"unknown\" # Change to \"fixed_verified\" when the camera stays still.\n",
|
| 262 |
"TIMING = {\"kind\": \"unknown\"}\n",
|
|
|
|
| 273 |
"if not source_video.is_file():\n",
|
| 274 |
" raise ValueError(\"VIDEO_PATH does not exist. Upload the video or correct its path.\")\n",
|
| 275 |
"OPTIONS = {\"discipline\": \"hitting\", \"handedness\": HANDEDNESS, \"view\": VIEW,\n",
|
| 276 |
+
" \"pitcher_direction\": PITCHER_DIRECTION,\n",
|
| 277 |
" \"camera_stability\": CAMERA_STABILITY, \"timing\": TIMING, \"single_swing\": SINGLE_SWING}\n",
|
| 278 |
"JOB_ROOT = WORKSPACE_ROOT / \"results\" / (\"session-\" + uuid.uuid4().hex[:12])\n",
|
| 279 |
"JOB_ROOT.mkdir(parents=True)\n",
|
|
|
|
| 389 |
" position(rep[\"end_frame\"]), rep[\"boundary_method\"]] for rep in track[\"reps\"]])\n",
|
| 390 |
"for rep in result[\"measurements\"][\"reps\"][:10]:\n",
|
| 391 |
" print(\"Swing\", rep[\"rep\"], \"| estimated physical events_ms:\", rep[\"events_ms\"])\n",
|
| 392 |
+
" detected = next(p for p in track[\"reps\"] if p[\"rep\"] == rep[\"rep\"])\n",
|
| 393 |
+
" table([\"Estimated moment\", \"Video frame\", \"Video position (s)\"],\n",
|
| 394 |
+
" [[key, event[\"frame\"], position(event[\"frame\"])] for key, event in detected[\"events\"].items()])\n",
|
| 395 |
" table([\"Measurement\", \"Value\", \"Unit\", \"Confidence\", \"Explanation\"],\n",
|
| 396 |
" [[m[\"key\"], m[\"value\"], m[\"unit\"], m[\"confidence\"], m[\"note\"]] for m in rep[\"metrics\"]])\n",
|
| 397 |
"print(\"Coach JSON:\", JOB_ROOT / \"coach-payload.json\")\n"
|
|
|
|
| 406 |
"source": [
|
| 407 |
"## 7. Watch previews of the detected swings\n",
|
| 408 |
"\n",
|
| 409 |
+
"These inspection clips show body points in green, toe/heel points in orange, and estimated event labels. They preserve playback presentation positions relative to each clip's first frame. They are resized to at most 960 pixels wide, have no audio, and are separate from the API's measurement output. Preview rendering does not alter measurement results. Invalid source timestamps cause a preview to be withheld rather than retimed.\n",
|
| 410 |
"\n",
|
| 411 |
"The default limit is ten clips; increase it up to 100 if needed. Inspect each range for missed preparation, truncated finish, merged swings or unrelated movements.\n"
|
| 412 |
],
|
tests/fixtures/walkthrough_pose.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"purpose":"Regression model observations only; no reference accuracy labels or video pixels.","pose_model_sha256":"bd033156e5104c4f5d2edfe0453e02661e30a2f3da453ec93c8764d561b83054","track":{"video":{"width":1920,"height":1080,"frame_count":117,"capture_fps":null,"playback_fps":30.0,"rotation_degrees_applied":0,"time_source":"unknown"},"frames":{"t_s":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"playback_t_s":[0.0,0.033,0.067,0.1,0.133,0.167,0.2,0.233,0.267,0.3,0.333,0.367,0.4,0.433,0.467,0.5,0.533,0.567,0.6,0.633,0.667,0.7,0.733,0.767,0.8,0.833,0.867,0.9,0.933,0.967,1.0,1.033,1.067,1.1,1.133,1.167,1.2,1.233,1.267,1.3,1.333,1.367,1.4,1.433,1.467,1.5,1.533,1.567,1.6,1.633,1.667,1.7,1.733,1.767,1.8,1.833,1.867,1.9,1.933,1.967,2.0,2.033,2.067,2.1,2.133,2.167,2.2,2.233,2.267,2.3,2.333,2.367,2.4,2.433,2.467,2.5,2.533,2.567,2.6,2.633,2.667,2.7,2.733,2.767,2.8,2.833,2.867,2.9,2.933,2.967,3.0,3.033,3.067,3.1,3.133,3.167,3.2,3.233,3.267,3.3,3.333,3.367,3.4,3.433,3.467,3.5,3.533,3.567,3.6,3.633,3.667,3.7,3.733,3.767,3.8,3.833,3.867],"kp":[[[1275.875,195.993],[1294.492,177.375],[1261.554,175.943],[1328.863,177.375],[1248.665,177.375],[1381.85,250.413],[1209.998,280.487],[1474.937,332.043],[1261.554,402.216],[1449.159,332.043],[1389.011,389.327],[1344.616,529.673],[1245.801,519.648],[1333.159,718.711],[1235.776,714.414],[1314.542,886.267],[1227.183,884.835]],[[1276.971,196.655],[1297.046,178.014],[1264.066,178.014],[1331.459,178.014],[1251.162,179.448],[1383.079,248.274],[1212.447,279.82],[1480.583,327.138],[1264.066,403.134],[1451.905,334.307],[1393.116,393.097],[1350.099,514.977],[1248.294,504.939],[1337.195,714.286],[1239.69,711.419],[1315.686,890.654],[1228.219,886.352]],[[1277.849,196.175],[1297.915,178.975],[1264.949,177.542],[1332.314,178.975],[1254.916,178.975],[1386.779,247.773],[1216.218,277.872],[1484.242,325.17],[1267.816,404.001],[1457.01,333.77],[1398.245,396.835],[1352.38,512.931],[1250.617,502.898],[1339.48,716.457],[1242.017,712.157],[1315.114,891.318],[1229.117,887.018]],[[1278.593,197.188],[1298.667,178.548],[1265.688,177.114],[1335.947,178.548],[1257.085,178.548],[1390.432,247.372],[1218.372,277.483],[1487.934,324.8],[1269.99,403.661],[1460.691,334.837],[1401.903,399.359],[1354.586,512.633],[1252.784,502.596],[1341.682,717.672],[1242.747,711.936],[1317.307,891.166],[1229.842,886.865]],[[1279.716,197.311],[1299.763,178.696],[1266.829,177.264],[1338.425,178.696],[1259.67,177.264],[1392.839,248.861],[1221.008,278.931],[1490.209,323.321],[1272.557,403.509],[1463.003,337.64],[1404.294,400.645],[1357.04,519.494],[1256.806,509.471],[1342.721,717.1],[1243.918,711.372],[1318.378,888.931],[1231.031,887.499]],[[1281.224,196.233],[1302.717,177.605],[1269.761,176.172],[1341.405,179.038],[1262.596,177.605],[1398.72,247.816],[1223.909,276.474],[1493.291,322.326],[1274.06,404.001],[1464.633,339.521],[1404.452,402.568],[1360.033,515.766],[1258.298,502.87],[1344.271,717.802],[1245.402,712.07],[1319.912,889.748],[1232.506,886.882]],[[1281.707,194.93],[1303.237,177.707],[1270.225,174.836],[1343.425,179.142],[1264.483,177.707],[1402.273,248.037],[1225.73,276.743],[1492.698,324.108],[1275.966,403.05],[1466.862,338.461],[1406.579,401.615],[1362.084,512.134],[1258.742,500.651],[1344.861,717.383],[1245.824,710.207],[1320.46,889.621],[1232.906,886.75]],[[1284.734,194.844],[1304.845,177.606],[1273.242,174.733],[1346.503,179.043],[1266.06,177.606],[1405.399,247.994],[1227.275,276.724],[1493.024,327.001],[1278.988,403.134],[1470.041,338.492],[1409.708,401.698],[1365.177,513.744],[1261.751,502.252],[1346.503,717.724],[1247.386,710.542],[1322.083,888.666],[1234.457,885.793]],[[1287.107,195.667],[1307.262,176.951],[1275.59,175.512],[1349.012,178.391],[1269.831,178.391],[1409.478,248.934],[1229.521,277.727],[1497.297,330.995],[1281.348,404.417],[1472.823,336.753],[1415.237,400.098],[1366.288,516.711],[1264.072,503.754],[1349.012,718.263],[1248.236,711.065],[1324.538,889.582],[1235.279,886.703]],[[1290.141,194.642],[1310.314,177.35],[1278.613,175.909],[1350.662,178.791],[1271.408,178.791],[1412.624,247.958],[1232.502,276.777],[1497.642,332.976],[1284.377,403.583],[1473.145,337.298],[1415.506,397.82],[1369.395,511.657],[1265.644,500.129],[1350.662,717.717],[1251.234,710.512],[1324.724,889.193],[1236.825,886.311]],[[1290.746,194.929],[1312.374,177.627],[1280.653,176.185],[1352.747,179.069],[1273.443,177.627],[1413.307,246.837],[1234.512,277.117],[1498.378,337.676],[1286.42,402.561],[1473.866,336.235],[1417.632,395.352],[1371.492,512.145],[1267.676,502.052],[1352.747,716.893],[1251.815,709.684],[1326.793,888.478],[1238.838,885.594]],[[1293.18,196.292],[1314.735,177.611],[1283.122,176.174],[1356.408,180.485],[1275.937,179.048],[1413.887,248.023],[1238.575,276.763],[1495.795,338.553],[1287.432,401.78],[1469.929,341.427],[1418.198,393.159],[1372.215,512.428],[1268.752,502.369],[1354.971,717.917],[1254.382,710.732],[1329.105,888.918],[1241.449,886.044]],[[1296.228,196.972],[1316.333,178.303],[1284.739,176.867],[1357.98,181.175],[1278.995,178.303],[1413.988,248.672],[1240.22,275.957],[1498.718,339.146],[1290.483,400.898],[1475.74,336.274],[1421.168,390.845],[1375.213,512.914],[1270.378,501.425],[1356.544,718.276],[1256.017,711.095],[1330.694,889.172],[1243.092,886.3]],[[1297.611,196.824],[1319.181,178.13],[1287.545,176.692],[1359.445,181.006],[1280.355,178.13],[1415.528,248.592],[1241.528,275.915],[1503.247,340.625],[1291.859,399.584],[1481.677,333.435],[1424.156,388.08],[1376.702,513.187],[1271.727,501.683],[1359.445,717.385],[1257.346,711.633],[1332.123,888.509],[1244.404,887.071]],[[1299.31,198.1],[1320.805,179.472],[1289.279,176.606],[1362.362,182.338],[1283.548,179.472],[1415.382,248.255],[1243.424,275.482],[1505.66,341.399],[1295.011,400.151],[1481.299,331.368],[1426.846,384.388],[1379.557,513.357],[1274.95,500.46],[1360.929,718.273],[1260.62,711.108],[1335.135,890.231],[1247.723,887.365]],[[1302.991,197.011],[1323.068,179.802],[1292.953,176.934],[1363.222,181.236],[1284.348,179.802],[1414.849,247.203],[1245.629,274.45],[1508.063,343.286],[1297.255,399.214],[1482.25,330.379],[1429.189,382.006],[1381.865,513.94],[1275.744,503.902],[1363.222,719.012],[1262.837,711.842],[1337.409,889.666],[1249.931,885.364]],[[1305.772,196.179],[1325.909,178.919],[1295.704,176.042],[1366.182,181.796],[1287.073,177.481],[1417.963,247.96],[1248.238,275.288],[1510.017,342.89],[1301.457,397.547],[1487.003,331.383],[1432.346,380.287],[1384.881,512.615],[1279.882,501.108],[1366.182,718.298],[1265.498,711.106],[1340.292,890.899],[1251.115,888.022]],[[1306.602,197.109],[1328.203,178.389],[1296.522,175.509],[1368.523,181.269],[1289.322,178.389],[1420.363,247.509],[1249.002,274.869],[1512.524,341.11],[1302.282,397.27],[1489.484,328.15],[1434.763,379.99],[1385.803,512.471],[1280.682,500.951],[1368.523,718.393],[1267.722,712.633],[1342.603,891.194],[1254.762,885.434]],[[1307.805,197.257],[1329.413,178.53],[1297.721,175.649],[1369.748,181.411],[1290.518,178.53],[1423.048,247.676],[1250.183,276.487],[1513.803,338.431],[1304.924,397.493],[1489.313,328.347],[1436.013,380.206],[1387.035,512.737],[1281.875,502.653],[1368.308,718.735],[1270.351,714.413],[1343.818,888.719],[1255.945,884.397]],[[1308.1,195.876],[1329.688,178.605],[1298.025,177.166],[1369.987,181.483],[1290.829,178.605],[1424.679,247.689],[1251.969,277.913],[1515.351,341.24],[1306.66,400.249],[1490.884,329.726],[1437.632,382.978],[1388.697,512.51],[1283.632,502.435],[1371.426,719.762],[1272.118,714.005],[1346.959,891.032],[1259.165,885.275]],[[1309.823,196.996],[1331.455,178.249],[1299.728,176.807],[1371.834,182.575],[1292.518,178.249],[1426.634,247.47],[1253.581,277.754],[1518.929,342.649],[1309.823,400.333],[1491.529,329.67],[1441.055,383.028],[1390.581,514.26],[1283.865,502.723],[1373.276,720.481],[1275.213,714.713],[1350.202,890.65],[1263.676,884.881]],[[1309.721,195.674],[1331.326,178.39],[1299.639,176.95],[1373.094,181.271],[1292.438,179.83],[1427.825,247.524],[1253.55,279.211],[1520.004,338.263],[1309.721,401.636],[1495.519,328.181],[1442.228,385.792],[1391.818,511.098],[1286.676,502.456],[1375.975,719.941],[1278.035,714.18],[1352.93,889.896],[1265.072,884.134]],[[1310.544,197.009],[1332.163,178.273],[1299.014,176.832],[1372.518,182.597],[1293.249,179.714],[1428.727,248.894],[1252.895,280.601],[1518.084,336.81],[1311.986,403.107],[1496.465,332.486],[1444.58,388.695],[1392.695,514.083],[1286.043,505.436],[1376.842,721.623],[1280.278,717.299],[1355.223,890.249],[1268.748,884.484]],[[1309.485,197.591],[1331.082,178.874],[1299.406,177.434],[1372.837,181.753],[1292.207,180.313],[1428.989,247.985],[1253.332,279.66],[1519.697,324.295],[1312.365,404.924],[1498.1,330.054],[1443.387,390.526],[1392.994,511.47],[1286.448,504.271],[1378.596,720.243],[1282.128,718.803],[1356.999,890.14],[1272.05,884.381]],[[1308.175,197.933],[1329.817,180.62],[1296.632,177.734],[1373.101,183.505],[1292.304,180.62],[1429.371,248.432],[1251.905,281.616],[1521.711,316.244],[1312.503,405.698],[1501.511,327.786],[1446.685,392.713],[1393.301,512.466],[1286.533,505.252],[1380.315,721.674],[1283.647,718.788],[1358.673,893.368],[1274.99,886.154]],[[1307.728,197.832],[1329.362,180.524],[1296.19,179.082],[1371.189,183.409],[1291.863,181.966],[1427.438,249.754],[1251.479,282.927],[1518.302,313.215],[1313.497,406.964],[1500.995,327.638],[1446.188,395.425],[1391.381,513.693],[1286.094,506.482],[1381.285,722.825],[1284.651,719.941],[1361.093,891.573],[1277.44,887.247]],[[1305.772,199.411],[1327.403,182.106],[1294.236,179.222],[1369.223,184.99],[1288.467,182.106],[1425.463,249.883],[1249.532,283.051],[1510.545,313.334],[1312.982,408.51],[1499.008,330.639],[1444.21,398.416],[1389.412,513.781],[1284.141,506.57],[1382.201,722.88],[1282.699,721.437],[1363.455,893.043],[1278.373,887.275]],[[1303.792,201.394],[1325.399,182.668],[1292.269,181.228],[1367.171,185.549],[1286.507,182.668],[1424.789,250.369],[1247.616,283.498],[1515.536,306.545],[1310.995,408.816],[1501.131,328.152],[1443.514,398.733],[1385.897,515.408],[1280.746,509.646],[1381.576,724.27],[1283.626,722.83],[1365.731,894.241],[1279.305,887.039]],[[1301.055,203.264],[1322.657,184.542],[1289.534,181.662],[1364.421,185.982],[1285.213,183.102],[1423.467,249.349],[1246.329,285.352],[1514.196,309.835],[1308.255,410.645],[1498.355,327.117],[1442.189,400.564],[1386.023,515.776],[1279.453,508.575],[1381.703,723.157],[1282.333,723.157],[1367.301,893.094],[1280.893,888.773]],[[1297.83,204.318],[1319.423,185.604],[1286.314,182.725],[1359.729,187.044],[1280.556,184.165],[1420.188,250.382],[1241.69,286.369],[1509.437,307.962],[1306.467,411.606],[1496.481,328.115],[1440.341,401.529],[1381.321,516.689],[1276.238,509.492],[1381.321,722.537],[1281.996,723.977],[1368.366,892.398],[1283.435,888.08]],[[1294.551,205.585],[1316.185,186.835],[1283.012,185.393],[1356.57,189.72],[1277.243,186.835],[1418.59,248.855],[1239.743,287.797],[1509.456,312.317],[1304.647,413.279],[1495.033,329.624],[1438.783,401.74],[1379.647,517.126],[1275.801,512.799],[1381.09,723.377],[1280.127,723.377],[1370.994,893.571],[1284.454,890.686]],[[1290.113,208.95],[1311.735,188.769],[1278.581,187.328],[1353.537,190.211],[1274.257,188.769],[1414.078,250.752],[1235.338,289.672],[1503.449,309.852],[1300.203,413.637],[1490.476,328.591],[1435.7,403.547],[1375.159,517.422],[1271.374,513.098],[1379.483,723.551],[1280.023,723.551],[1372.276,893.643],[1285.789,890.76]],[[1285.523,211.228],[1307.095,192.532],[1275.457,189.656],[1348.8,193.97],[1268.266,191.094],[1410.639,251.495],[1230.875,290.324],[1499.801,310.457],[1297.028,415.439],[1485.42,329.153],[1430.772,403.934],[1374.686,518.983],[1268.266,516.107],[1380.439,723.194],[1276.895,724.632],[1371.81,892.891],[1286.962,891.453]],[[1281.004,214.721],[1302.536,194.624],[1269.52,193.188],[1345.6,196.059],[1263.778,193.188],[1405.891,253.479],[1226.455,290.801],[1492.02,309.462],[1291.052,415.688],[1480.536,330.995],[1427.423,404.204],[1368.568,521.914],[1262.342,517.608],[1380.052,720.011],[1273.826,722.882],[1374.31,887.962],[1289.617,892.269]],[[1276.092,217.276],[1297.512,197.284],[1266.096,195.856],[1341.78,198.712],[1260.384,195.856],[1401.757,255.833],[1221.827,292.961],[1487.438,311.525],[1287.516,417.198],[1476.014,332.945],[1424.605,402.918],[1364.629,524.299],[1257.528,521.443],[1380.337,718.509],[1271.808,724.221],[1374.625,884.158],[1288.944,891.298]],[[1273.597,219.947],[1294.95,200.018],[1262.208,198.594],[1339.08,201.441],[1256.514,198.594],[1400.293,256.96],[1218.078,293.972],[1485.706,312.478],[1283.562,417.821],[1471.47,333.832],[1420.223,403.586],[1360.433,526.011],[1252.243,524.588],[1381.787,725.308],[1270.75,728.155],[1373.245,877.628],[1290.679,893.287]],[[1268.147,223.536],[1290.765,203.745],[1258.251,200.917],[1333.176,205.158],[1252.596,202.331],[1395.378,260.292],[1214.427,297.047],[1481.612,315.425],[1280.87,420.037],[1468.889,335.217],[1417.996,404.487],[1355.795,527.477],[1248.355,530.304],[1379.827,719.737],[1268.147,729.633],[1369.931,872.414],[1289.352,893.62]],[[1265.801,226.122],[1285.606,206.317],[1254.483,204.902],[1330.876,203.488],[1248.825,203.488],[1390.292,260.075],[1210.629,299.686],[1476.588,318.076],[1278.533,421.348],[1463.856,333.638],[1415.757,404.372],[1350.682,527.449],[1245.995,530.278],[1371.902,714.186],[1265.801,728.333],[1364.828,872.63],[1289.85,895.264]],[[1261.338,228.21],[1281.113,208.435],[1250.038,207.022],[1326.312,205.61],[1244.388,205.61],[1385.637,262.109],[1207.663,301.659],[1473.211,321.434],[1275.463,421.72],[1461.911,334.146],[1412.474,403.358],[1344.674,526.245],[1240.15,531.894],[1363.037,712.693],[1265.575,726.818],[1355.974,870.891],[1291.0,894.904]],[[1257.019,229.469],[1278.266,211.055],[1245.688,208.222],[1322.176,209.638],[1241.438,208.222],[1383.083,263.463],[1203.194,303.124],[1469.486,327.203],[1272.6,423.522],[1458.154,337.118],[1408.579,403.691],[1339.173,526.922],[1235.773,532.588],[1349.088,711.06],[1264.101,728.057],[1343.422,871.118],[1291.014,895.198]],[[1253.281,232.07],[1273.218,212.133],[1241.888,209.285],[1317.365,212.133],[1236.192,210.709],[1378.601,266.248],[1199.166,304.699],[1462.622,336.029],[1268.946,424.322],[1454.077,338.877],[1405.658,401.537],[1333.03,525.432],[1229.072,533.977],[1335.878,713.412],[1258.977,729.077],[1327.334,880.03],[1290.307,895.695]],[[1248.435,233.289],[1268.485,214.671],[1236.978,211.807],[1312.881,213.239],[1232.681,211.807],[1374.463,267.66],[1195.446,304.896],[1456.095,343.563],[1265.621,423.763],[1451.798,339.267],[1401.674,399.417],[1327.202,529.741],[1226.953,535.47],[1320.042,715.919],[1258.46,733.105],[1308.585,892.072],[1285.67,890.64]],[[1243.627,234.779],[1263.759,216.085],[1233.561,213.209],[1309.775,214.647],[1227.809,213.209],[1371.609,269.291],[1190.421,308.117],[1455.013,344.067],[1262.321,424.595],[1444.947,339.753],[1398.931,397.273],[1324.155,532.445],[1222.057,535.321],[1305.461,717.947],[1252.255,735.202],[1286.767,886.192],[1285.329,890.506]],[[1238.344,236.835],[1259.93,216.687],[1228.27,215.248],[1304.542,216.687],[1223.953,215.248],[1366.423,274.251],[1185.097,308.789],[1451.33,353.401],[1258.491,423.917],[1442.695,340.449],[1396.644,395.135],[1317.494,534.727],[1215.318,537.605],[1291.59,721.81],[1245.539,734.761],[1259.93,906.014],[1293.029,891.623]],[[1234.486,238.77],[1254.805,218.451],[1224.327,217.0],[1299.795,219.903],[1219.973,217.0],[1360.751,276.504],[1180.787,309.884],[1446.378,353.424],[1254.805,424.538],[1440.573,340.362],[1389.777,392.609],[1311.406,539.192],[1209.814,537.741],[1276.574,723.51],[1238.84,730.766],[1240.291,912.181],[1291.088,894.765]],[[1230.797,239.35],[1251.117,220.481],[1219.186,217.579],[1296.111,221.933],[1213.38,219.03],[1352.717,278.538],[1175.643,311.921],[1441.253,359.818],[1251.117,425.132],[1433.996,340.949],[1386.099,391.749],[1306.271,544.148],[1204.672,544.148],[1261.277,731.381],[1236.603,737.187],[1222.089,917.163],[1296.111,902.649]],[[1224.735,243.729],[1246.392,224.96],[1214.629,222.073],[1291.148,226.404],[1208.854,222.073],[1346.01,282.71],[1169.873,314.472],[1426.86,362.116],[1246.392,427.085],[1429.747,344.791],[1382.104,390.991],[1295.479,549.803],[1194.417,548.359],[1250.723,734.602],[1233.398,740.377],[1208.854,917.958],[1296.923,902.077]],[[1219.773,246.081],[1241.363,228.809],[1209.698,224.492],[1285.981,230.249],[1203.94,227.37],[1337.797,284.943],[1165.079,316.608],[1422.716,369.862],[1244.241,428.874],[1419.837,345.394],[1376.658,391.452],[1285.981,555.534],[1186.669,556.973],[1241.363,741.205],[1231.287,746.962],[1198.183,923.998],[1297.496,900.969]],[[1214.187,250.964],[1235.702,232.318],[1204.146,229.449],[1281.601,235.186],[1199.843,230.883],[1330.368,288.257],[1159.682,321.246],[1407.822,355.67],[1240.005,431.69],[1402.085,344.196],[1370.529,391.529],[1278.732,557.911],[1178.328,557.911],[1234.267,742.94],[1224.227,748.678],[1195.54,927.97],[1295.944,899.283]],[[1208.102,255.796],[1229.557,237.202],[1198.09,234.342],[1276.757,240.063],[1193.799,235.772],[1321.097,295.845],[1153.75,327.312],[1355.424,368.791],[1236.708,436.015],[1388.321,344.476],[1368.297,390.245],[1271.036,560.452],[1170.914,563.313],[1229.557,749.253],[1209.532,756.405],[1199.52,930.903],[1292.49,896.575]],[[1201.234,261.479],[1224.001,242.98],[1192.696,238.712],[1270.958,244.403],[1187.005,238.712],[1312.224,294.206],[1147.162,331.203],[1352.066,341.163],[1232.539,439.346],[1377.679,344.009],[1363.449,396.658],[1266.689,557.45],[1162.815,563.142],[1229.693,752.393],[1192.696,766.623],[1201.234,933.107],[1283.765,891.842]],[[1195.814,266.083],[1217.194,247.554],[1185.836,244.703],[1265.656,247.554],[1180.135,243.278],[1302.715,270.359],[1143.076,333.075],[1336.924,347.329],[1227.171,444.253],[1369.707,348.754],[1358.304,402.917],[1258.529,562.557],[1153.053,568.258],[1227.171,754.98],[1171.583,764.957],[1202.94,934.575],[1274.208,886.113]],[[1189.222,271.491],[1210.492,253.058],[1179.296,248.804],[1258.702,253.058],[1172.207,247.386],[1292.733,262.983],[1138.176,335.3],[1331.018,359.405],[1223.253,450.154],[1372.139,356.569],[1353.706,407.616],[1248.777,563.591],[1142.429,566.427],[1224.671,757.852],[1149.519,766.36],[1201.984,935.098],[1253.031,869.871]],[[1182.158,278.323],[1203.234,260.057],[1170.917,255.842],[1251.006,258.652],[1165.297,253.032],[1283.322,271.297],[1130.17,341.551],[1324.069,362.627],[1218.689,456.766],[1364.816,362.627],[1349.361,416.019],[1239.765,569.171],[1135.791,567.766],[1221.5,758.855],[1121.74,757.45],[1201.829,937.298],[1241.171,854.399]],[[1174.575,282.47],[1195.58,264.265],[1163.372,260.064],[1243.192,261.465],[1157.77,257.263],[1274.0,274.068],[1124.161,345.486],[1317.412,367.892],[1216.585,463.117],[1367.825,366.492],[1344.018,426.707],[1236.19,569.544],[1125.562,566.744],[1216.585,768.396],[1105.957,757.193],[1202.582,935.039],[1217.986,846.816]],[[1167.918,286.61],[1188.81,267.11],[1156.776,262.932],[1237.558,265.718],[1151.204,261.539],[1266.806,275.467],[1119.17,352.071],[1312.768,360.428],[1215.273,469.065],[1371.266,368.784],[1344.803,435.638],[1229.201,572.132],[1116.385,565.168],[1213.88,768.516],[1088.529,753.195],[1201.345,935.651],[1174.882,824.228]],[[1160.221,289.438],[1181.054,271.382],[1149.11,267.216],[1231.054,269.994],[1144.943,264.438],[1269.943,326.938],[1114.387,357.494],[1361.61,358.883],[1212.999,474.161],[1369.943,368.605],[1343.554,440.827],[1221.332,571.383],[1106.054,567.216],[1212.999,771.384],[1074.109,756.106],[1200.499,938.051],[1139.387,822.773]],[[1152.665,292.528],[1174.863,274.492],[1142.954,268.943],[1220.645,273.105],[1137.405,267.556],[1263.652,309.176],[1109.658,363.282],[1355.216,341.084],[1213.708,478.43],[1359.378,372.993],[1345.505,446.521],[1213.708,569.994],[1097.172,563.057],[1210.933,768.383],[1055.552,748.96],[1201.222,936.25],[1098.559,819.714]],[[1146.579,295.91],[1168.624,277.999],[1136.935,273.865],[1214.09,276.621],[1130.046,271.11],[1260.934,306.932],[1106.624,368.931],[1351.867,330.354],[1214.09,480.53],[1357.378,360.665],[1344.978,450.22],[1207.201,570.085],[1087.335,560.441],[1209.957,769.861],[1032.225,751.95],[1198.935,936.571],[1051.513,838.75]],[[1139.918,298.701],[1161.845,280.886],[1128.955,276.775],[1207.068,278.145],[1124.844,274.034],[1257.772,305.553],[1101.547,372.702],[1338.625,326.109],[1215.29,479.593],[1356.44,358.998],[1348.218,448.074],[1198.845,568.669],[1076.88,561.817],[1208.438,768.746],[1008.361,746.82],[1196.104,938.675],[1004.249,856.451]],[[1132.344,302.389],[1155.577,283.256],[1121.41,279.156],[1200.678,280.522],[1115.943,276.422],[1247.145,305.123],[1098.177,378.924],[1329.146,317.423],[1219.811,481.425],[1352.38,358.423],[1349.646,447.258],[1189.744,571.626],[1066.743,564.792],[1206.145,768.428],[990.209,736.994],[1193.844,937.897],[951.941,875.029]],[[1123.81,304.558],[1145.653,285.446],[1112.889,282.715],[1190.705,284.081],[1107.428,279.985],[1235.756,303.193],[1093.776,385.104],[1321.762,310.019],[1219.373,480.667],[1346.336,350.975],[1347.701,443.807],[1172.957,569.405],[1058.281,561.213],[1202.991,763.261],[977.735,726.401],[1193.435,938.005],[908.111,884.763]],[[1115.873,307.717],[1137.64,290.031],[1104.99,285.95],[1181.174,285.95],[1098.188,283.229],[1223.348,298.194],[1088.665,386.622],[1307.695,303.636],[1213.825,475.05],[1340.345,348.53],[1340.345,441.04],[1163.489,567.56],[1046.491,560.758],[1200.22,760.742],[960.784,729.452],[1192.058,937.598],[865.553,904.948]],[[1107.242,311.899],[1130.708,292.574],[1096.199,288.433],[1170.739,288.433],[1087.916,284.292],[1208.009,296.715],[1082.395,389.2],[1296.352,295.335],[1210.769,472.022],[1329.481,339.507],[1339.144,431.992],[1150.033,571.409],[1035.462,563.127],[1194.205,759.14],[942.977,735.673],[1191.444,937.207],[828.407,904.078]],[[1097.882,315.022],[1118.087,296.26],[1086.337,291.931],[1158.496,293.374],[1077.678,287.601],[1193.133,296.26],[1071.905,390.068],[1278.281,287.601],[1207.565,468.0],[1324.463,339.556],[1330.236,424.704],[1136.848,573.353],[1022.837,563.25],[1187.36,755.194],[927.586,740.762],[1188.803,934.15],[806.358,908.172]],[[1086.929,319.771],[1108.584,301.004],[1073.936,296.673],[1147.563,295.229],[1065.274,290.898],[1177.88,295.229],[1062.386,393.399],[1261.613,277.905],[1203.866,464.138],[1310.698,329.877],[1325.134,416.497],[1120.133,568.083],[1006.083,563.752],[1177.88,751.429],[910.801,747.098],[1187.986,933.331],[792.42,916.007]],[[1076.366,323.548],[1097.692,306.487],[1064.992,303.643],[1137.501,299.378],[1055.039,295.113],[1163.093,299.378],[1055.039,397.479],[1242.711,273.786],[1198.637,464.301],[1295.316,323.548],[1316.642,408.853],[1101.957,570.933],[988.217,568.089],[1164.514,750.074],[904.333,745.809],[1185.841,933.48],[790.593,920.684]],[[1063.402,331.22],[1084.346,314.464],[1052.231,310.276],[1124.838,304.69],[1042.457,300.502],[1151.367,300.502],[1043.854,401.034],[1228.163,278.161],[1190.463,461.074],[1275.637,317.257],[1307.751,401.034],[1085.742,574.173],[968.455,569.984],[1148.575,752.897],[893.055,751.5],[1184.878,935.81],[799.504,928.828]],[[1050.18,339.681],[1072.092,323.247],[1039.224,319.138],[1113.178,316.399],[1029.637,310.921],[1137.829,310.921],[1032.376,410.897],[1209.045,295.856],[1178.915,460.2],[1258.348,315.03],[1292.586,395.832],[1069.353,580.718],[951.574,572.501],[1130.982,756.017],[878.989,758.756],[1177.546,929.947],[805.034,935.425]],[[1036.505,350.44],[1059.337,331.637],[1025.761,327.608],[1100.97,326.265],[1017.703,318.207],[1127.831,327.608],[1012.331,410.876],[1196.325,335.667],[1157.377,464.597],[1248.703,337.01],[1272.878,398.789],[1056.65,585.469],[939.807,582.783],[1110.372,760.063],[867.284,754.691],[1166.779,930.627],[800.132,938.686]],[[1026.444,351.421],[1047.12,333.33],[1014.814,326.869],[1089.764,328.161],[1005.768,313.947],[1114.316,357.883],[978.632,391.481],[1171.174,417.325],[1127.238,470.307],[1218.987,372.097],[1247.416,419.91],[1049.704,586.608],[926.942,580.146],[1084.595,772.689],[845.532,748.137],[1164.713,932.926],[796.427,939.387]],[[1012.942,342.588],[1035.158,328.212],[1003.794,319.065],[1079.59,324.292],[993.339,305.996],[1108.34,373.951],[947.6,355.656],[1138.398,490.259],[1032.544,471.964],[1199.819,448.441],[1163.227,470.657],[1040.385,585.658],[918.85,572.59],[1058.681,781.682],[835.213,741.171],[1165.841,924.127],[793.395,934.581]],[[1000.797,333.72],[1023.382,323.091],[994.154,312.463],[1072.538,319.106],[987.511,295.192],[1105.751,401.475],[943.669,315.12],[1107.08,535.658],[937.027,450.631],[1148.264,514.401],[1059.252,507.758],[1022.053,591.456],[918.427,566.214],[1026.039,792.066],[837.386,734.938],[1168.192,903.663],[793.545,927.576]],[[995.678,330.629],[1018.573,322.548],[990.291,309.081],[1069.75,321.201],[987.598,291.573],[1088.605,414.128],[960.663,290.226],[1033.388,540.724],[886.591,366.991],[891.978,517.829],[881.204,523.216],[1005.106,579.78],[917.566,555.538],[998.372,797.956],[852.921,734.658],[1165.371,884.149],[795.011,928.592]],[[995.881,328.524],[1017.206,321.416],[991.616,308.621],[1069.806,324.259],[994.46,297.248],[1064.12,415.244],[975.978,285.875],[968.87,516.18],[883.572,317.151],[840.923,492.012],[836.658,406.714],[987.351,588.683],[920.535,565.937],[970.292,794.821],[857.983,735.112],[1152.261,871.589],[796.852,922.768]],[[995.268,328.003],[1017.899,321.968],[990.742,308.389],[1069.197,323.477],[992.251,297.828],[1032.987,409.476],[981.689,302.354],[910.778,472.843],[910.778,334.038],[771.973,463.791],[814.218,398.914],[980.181,587.508],[918.322,554.316],[945.479,789.681],[857.972,733.857],[1117.477,884.733],[797.622,919.434]],[[993.642,332.193],[1014.751,323.146],[990.626,311.084],[1069.031,326.162],[1002.689,308.068],[1007.212,413.613],[1001.181,321.638],[883.574,422.66],[916.745,353.302],[753.905,409.09],[802.154,384.965],[980.072,577.961],[916.745,544.79],[930.315,784.527],[856.434,731.755],[1109.741,893.088],[797.63,918.72]],[[986.489,325.238],[1006.397,319.112],[986.489,306.861],[1063.059,326.769],[1004.866,309.924],[1014.054,400.276],[998.74,335.958],[883.885,391.088],[925.233,346.677],[775.155,351.272],[822.629,331.363],[977.301,584.045],[911.45,550.354],[929.827,795.378],[851.725,731.059],[1109.001,894.92],[796.595,919.422]],[[978.8,318.458],[996.668,310.336],[978.8,300.589],[1051.898,321.706],[1024.283,311.96],[1004.79,391.556],[1071.391,349.321],[894.331,346.072],[925.195,333.077],[839.102,276.223],[869.965,279.472],[967.429,596.23],[910.575,563.742],[931.692,799.28],[848.848,731.055],[1118.498,898.368],[796.867,916.236]],[[966.299,301.61],[982.846,294.715],[967.678,285.062],[1036.627,315.4],[1031.111,301.61],[973.194,387.106],[1077.996,338.842],[924.929,315.4],[971.815,300.231],[929.066,229.903],[933.203,235.419],[956.646,592.574],[905.624,570.511],[948.372,800.8],[849.085,727.714],[1134.534,902.845],[796.684,919.393]],[[958.264,279.491],[973.337,269.899],[966.486,260.308],[1022.664,295.933],[1036.366,287.712],[941.822,350.742],[1085.694,335.669],[958.264,264.419],[1066.511,294.563],[1028.145,202.759],[1058.289,213.721],[958.264,589.158],[913.047,571.345],[958.264,797.429],[851.388,727.549],[1148.723,905.676],[797.95,919.378]],[[947.603,261.612],[963.856,256.736],[952.479,248.61],[1007.738,284.366],[1028.867,274.614],[932.975,338.0],[1085.751,336.375],[963.856,271.364],[1077.625,305.495],[1072.749,224.231],[1089.002,237.233],[962.23,585.041],[921.599,570.414],[965.481,791.451],[854.962,726.44],[1150.762,905.22],[801.328,913.346]],[[940.5,249.495],[959.574,243.137],[950.037,235.19],[1007.258,268.569],[1007.258,257.442],[929.374,322.611],[1089.911,325.79],[957.984,276.516],[1118.522,327.38],[1075.606,249.495],[1151.901,249.495],[956.395,581.696],[926.195,570.57],[967.521,786.739],[864.205,729.518],[1156.669,907.54],[802.215,912.308]],[[939.593,243.353],[955.898,236.831],[946.115,227.047],[1003.186,262.92],[998.294,246.614],[926.548,316.73],[1089.607,326.513],[946.115,275.965],[1149.939,328.144],[1073.301,262.92],[1211.901,249.875],[960.79,580.886],[924.917,571.102],[977.096,787.971],[872.738,729.269],[1161.353,908.634],[804.253,915.157]],[[940.204,241.451],[956.243,235.619],[947.494,225.412],[1002.901,258.948],[1008.734,250.2],[919.791,321.646],[1104.967,318.73],[940.204,270.613],[1188.078,331.852],[1067.057,258.948],[1271.188,261.864],[957.701,585.559],[934.371,576.81],[983.946,792.606],[876.048,732.825],[1164.748,913.627],[803.144,913.627]],[[940.25,240.496],[957.888,230.697],[948.089,222.858],[999.043,256.174],[1014.721,246.375],[916.733,314.966],[1102.909,314.966],[916.733,277.731],[1208.736,338.483],[1059.795,260.093],[1316.523,285.57],[963.767,583.452],[955.928,573.654],[987.284,789.226],[877.538,730.434],[1165.622,912.691],[806.987,910.731]],[[942.634,239.576],[958.506,231.64],[946.602,225.689],[1000.168,257.431],[1012.071,245.528],[918.827,322.9],[1105.315,314.965],[900.972,289.174],[1224.35,348.691],[1041.83,259.415],[1345.368,307.029],[970.409,576.841],[946.602,568.905],[990.248,789.12],[877.165,731.586],[1168.8,916.09],[807.728,910.138]],[[941.11,238.516],[955.869,230.082],[947.435,223.756],[1002.255,257.492],[1012.797,249.058],[920.025,327.071],[1105.569,316.528],[890.507,297.552],[1232.076,358.697],[955.869,265.926],[1362.8,331.288],[979.062,577.977],[957.977,569.543],[989.604,788.822],[877.856,729.785],[1175.148,917.437],[806.169,911.112]],[[940.626,239.122],[957.237,230.817],[948.931,224.588],[1000.84,259.886],[1007.069,249.504],[921.939,332.558],[1110.887,322.176],[890.794,299.336],[1235.468,367.856],[957.237,272.344],[1368.354,349.169],[978.0,581.72],[959.313,573.415],[990.458,787.279],[878.335,731.217],[1175.254,918.089],[807.74,909.783]],[[941.668,242.849],[956.261,235.553],[947.14,226.433],[1001.862,259.266],[1000.038,248.321],[917.955,332.228],[1107.658,324.932],[890.594,303.043],[1229.87,372.358],[958.085,266.562],[1372.147,366.885],[972.677,580.301],[1000.038,571.18],[990.918,786.42],[879.65,731.698],[1178.796,921.401],[804.864,912.28]],[[934.998,244.607],[952.642,238.19],[944.622,230.17],[1002.367,262.251],[999.159,251.023],[915.75,337.639],[1103.419,324.807],[891.69,300.747],[1231.741,377.74],[959.058,270.271],[1369.686,379.344],[970.286,589.47],[1013.595,576.638],[991.138,789.971],[880.461,733.831],[1178.808,923.105],[805.073,911.877]],[[932.358,245.59],[951.292,239.279],[943.403,231.39],[998.628,264.525],[998.628,255.058],[908.69,340.261],[1102.765,327.639],[899.223,296.082],[1228.993,379.708],[963.915,267.68],[1366.266,387.597],[970.226,589.561],[1014.406,578.516],[990.738,791.526],[883.445,736.301],[1178.502,928.799],[806.13,913.02]],[[927.501,246.762],[946.352,240.478],[938.497,232.624],[995.051,267.184],[991.909,256.188],[907.079,342.589],[1100.303,326.88],[897.653,297.032],[1222.836,377.149],[955.778,267.184],[1359.507,388.146],[971.487,592.367],[1009.189,581.371],[991.909,793.446],[881.944,735.322],[1178.85,930.117],[806.539,912.837]],[[924.619,246.216],[941.835,241.051],[934.949,230.721],[990.041,268.597],[988.319,256.545],[903.96,342.627],[1100.224,327.132],[900.516,292.699],[1219.016,373.616],[953.887,270.318],[1346.416,380.502],[969.381,592.262],[1012.422,580.21],[993.484,790.248],[881.578,736.878],[1179.419,927.978],[805.827,912.483]],[[923.877,245.712],[940.683,240.11],[931.346,232.641],[987.366,268.12],[985.499,253.182],[903.336,344.681],[1095.671,324.14],[890.265,297.998],[1209.578,361.487],[944.417,256.916],[1336.556,367.089],[974.295,594.902],[957.489,583.698],[994.835,789.104],[880.928,734.952],[1179.7,929.154],[808.103,914.215]],[[915.774,247.133],[934.155,240.449],[925.8,232.094],[985.956,267.185],[984.285,258.83],[910.761,349.063],[1086.215,318.985],[879.013,298.934],[1199.842,350.734],[922.458,267.185],[1326.837,347.392],[970.917,586.344],[949.194,574.647],[992.64,786.862],[879.013,733.391],[1179.79,928.896],[805.489,913.857]],[[918.277,255.051],[933.747,245.382],[924.079,239.581],[980.157,268.587],[976.289,256.985],[908.609,349.803],[1086.512,311.129],[869.934,305.328],[1194.8,336.267],[898.94,253.117],[1314.691,326.599],[978.223,589.585],[953.084,579.917],[993.693,786.825],[879.603,732.681],[1181.264,929.921],[808.055,912.518]],[[912.861,252.571],[928.017,243.098],[918.544,237.414],[977.275,267.727],[969.697,256.36],[909.072,349.192],[1079.58,307.512],[861.708,315.091],[1187.569,318.88],[873.075,256.36],[1301.241,296.145],[981.064,593.588],[950.752,582.221],[992.431,783.042],[876.865,733.784],[1179.991,928.921],[808.661,915.66]],[[907.214,253.385],[925.882,244.051],[912.814,236.584],[974.418,270.186],[987.486,255.252],[905.347,350.458],[1073.358,303.788],[849.343,320.59],[1176.031,301.922],[849.343,247.785],[1282.438,266.453],[980.018,587.54],[942.683,576.34],[1002.42,789.153],[877.345,735.017],[1183.498,929.163],[808.274,916.095]],[[903.774,251.946],[922.085,242.79],[909.267,235.466],[969.692,266.594],[991.664,253.777],[903.774,350.822],[1066.738,297.722],[841.518,327.019],[1163.783,281.242],[821.377,248.284],[1258.998,237.297],[984.34,585.197],[944.057,572.379],[997.158,781.119],[874.477,733.512],[1185.756,931.265],[806.728,914.786]],[[902.144,250.686],[921.011,243.825],[907.29,233.534],[974.181,267.837],[970.751,252.401],[900.429,351.881],[1065.085,288.419],[833.537,327.868],[1149.129,262.692],[795.803,254.116],[1231.457,211.237],[982.757,583.429],[943.308,569.708],[1006.77,785.82],[871.271,734.364],[1186.863,929.894],[807.809,916.173]],[[899.153,252.303],[918.307,245.339],[904.377,236.632],[974.027,266.233],[960.097,254.045],[909.601,353.295],[1057.606,280.163],[822.539,328.918],[1135.962,245.339],[768.561,257.527],[1205.611,184.395],[986.215,576.174],[940.943,563.985],[1012.334,786.864],[867.811,731.144],[1189.94,931.386],[805.127,915.715]],[[896.018,249.721],[917.023,244.47],[903.019,232.216],[971.287,265.475],[957.283,249.721],[910.021,354.748],[1050.057,274.227],[811.996,333.742],[1113.073,233.967],[741.978,272.477],[1170.838,167.45],[990.542,573.554],[946.781,559.55],[1023.8,787.108],[864.509,729.343],[1191.843,928.894],[804.994,914.891]],[[891.77,244.568],[912.733,241.074],[900.505,228.846],[966.887,262.037],[977.369,249.808],[912.733,356.37],[1040.258,270.771],[802.678,344.142],[1089.171,216.617],[718.826,288.24],[1136.338,148.488],[991.344,569.493],[938.937,553.771],[1028.029,784.363],[856.832,723.221],[1193.986,929.356],[807.919,917.128]],[[890.346,245.421],[912.075,239.988],[897.589,229.124],[964.586,261.717],[957.343,247.231],[919.318,355.876],[1035.205,268.96],[797.998,354.065],[1065.988,201.963],[692.975,305.175],[1104.013,134.966],[989.937,569.543],[930.182,551.436],[1031.584,783.211],[848.699,716.213],[1196.361,931.691],[808.863,915.395]],[[885.084,243.303],[908.876,235.983],[892.405,225.002],[960.119,257.944],[960.119,243.303],[919.857,356.771],[1024.174,272.585],[789.918,364.091],[1040.645,197.55],[674.62,325.659],[1055.286,131.666],[994.892,570.895],[929.007,550.764],[1035.154,779.529],[839.331,713.645],[1196.205,931.429],[811.879,918.618]],[[880.726,240.362],[903.728,236.528],[888.394,225.027],[953.566,257.613],[947.816,244.195],[909.479,363.039],[1012.988,280.615],[781.051,374.54],[1020.656,202.025],[656.456,347.705],[1012.988,127.268],[993.82,571.975],[924.814,554.723],[1035.99,778.993],[828.972,715.738],[1197.005,932.34],[811.72,926.59]],[[873.02,239.218],[894.591,233.335],[880.864,221.569],[949.499,256.867],[927.928,239.218],[914.201,366.683],[996.563,284.321],[774.97,390.215],[988.719,201.959],[641.621,370.605],[982.836,107.831],[986.758,576.51],[916.162,558.861],[1033.822,778.494],[822.034,723.586],[1192.663,927.53],[818.112,929.491]],[[865.479,238.31],[887.171,234.366],[873.367,220.562],[938.444,258.03],[924.64,242.254],[912.807,366.491],[983.8,289.582],[766.879,403.959],[977.884,384.239],[630.81,400.015],[926.612,388.183],[981.828,573.552],[904.919,559.748],[1023.24,778.641],[816.179,731.313],[1188.889,926.542],[818.151,940.346]],[[857.974,235.066],[881.29,231.18],[867.689,217.578],[929.866,258.382],[918.208,244.781],[912.379,369.134],[968.726,293.356],[758.88,419.653],[906.549,211.749],[620.925,427.425],[879.347,130.142],[976.498,577.038],[896.834,559.55],[1017.302,782.998],[809.398,736.366],[1184.402,922.896],[821.056,942.326]],[[852.185,233.946],[876.297,230.237],[859.604,217.253],[924.521,258.059],[907.828,243.22],[909.683,371.2],[952.343,287.735],[761.3,436.118],[861.459,209.834],[624.046,460.23],[829.927,133.788],[967.181,580.791],[883.716,560.388],[1006.132,788.527],[802.106,744.012],[1173.062,920.216],[822.508,948.038]],[[843.801,230.595],[868.125,224.981],[849.414,211.883],[916.774,253.048],[890.579,232.466],[914.903,369.058],[914.903,281.115],[763.342,449.516],[840.058,211.883],[632.364,490.681],[787.667,140.781],[956.068,578.623],[871.868,559.912],[993.49,790.06],[795.151,741.411],[1163.763,913.554],[821.347,945.363]],[[840.017,226.312],[863.698,220.847],[843.66,208.096],[909.239,246.35],[872.806,222.669],[914.703,364.756],[881.914,275.496],[781.725,461.302],[805.406,217.204],[652.389,521.415],[743.47,140.695],[947.493,570.599],[861.876,556.026],[978.46,791.016],[790.833,743.654],[1151.515,905.779],[819.979,944.033]],[[830.283,214.629],[853.243,212.863],[839.114,196.967],[904.463,241.122],[877.97,219.928],[916.826,364.755],[867.373,265.848],[794.959,474.258],[789.661,232.291],[674.859,550.204],[703.118,161.643],[943.319,566.1],[858.542,551.97],[962.747,792.171],[787.894,744.484],[1139.365,898.142],[819.686,945.829]],[[823.795,208.717],[847.945,206.992],[834.145,191.467],[897.969,236.317],[870.37,217.342],[920.394,358.791],[844.495,265.642],[815.17,484.715],[765.146,243.217],[703.046,574.414],[671.996,177.668],[937.644,558.889],[851.395,545.089],[944.544,784.862],[785.845,745.188],[1122.217,888.361],[818.62,945.286]],[[819.311,203.098],[845.354,197.89],[829.728,185.736],[893.967,229.141],[862.715,210.043],[925.218,352.411],[834.936,267.337],[841.881,489.57],[734.237,253.448],[744.654,590.269],[637.011,197.89],[939.108,557.281],[848.826,550.337],[937.372,788.195],[786.323,746.526],[1105.782,880.213],[819.311,946.188]],[[815.365,194.974],[839.212,189.864],[827.288,177.94],[890.313,222.228],[857.949,203.491],[929.491,346.575],[825.585,273.329],[868.169,496.472],[716.569,266.516],[786.407,608.895],[607.552,223.931],[939.711,556.09],[856.246,545.87],[926.084,786.047],[789.814,745.166],[1087.905,872.919],[820.475,946.164]]],"conf":[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0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,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0]],"kp_extra":[[[1327.43,957.872],[1350.344,949.28],[1293.06,909.181],[1241.504,955.008],[1209.998,950.712],[1231.48,907.749]],[[1327.157,959.48],[1350.099,949.443],[1295.612,909.294],[1242.558,956.613],[1212.447,950.877],[1232.521,909.294]],[[1330.881,960.116],[1353.813,950.083],[1295.048,911.384],[1243.45,957.249],[1213.351,950.083],[1233.417,908.518]],[[1333.079,961.424],[1354.586,949.954],[1297.233,911.24],[1244.181,957.123],[1214.07,948.52],[1232.71,909.806]],[[1334.13,960.527],[1355.608,950.504],[1298.331,910.41],[1243.918,956.231],[1213.848,950.504],[1233.895,910.41]],[[1334.241,959.959],[1355.734,949.929],[1298.419,911.241],[1245.402,955.661],[1215.311,948.496],[1235.372,909.808]],[[1334.814,959.951],[1356.343,949.904],[1298.931,909.715],[1245.824,955.645],[1215.683,948.468],[1235.777,909.715]],[[1336.448,960.49],[1357.995,950.435],[1301.972,910.213],[1248.822,956.181],[1218.656,948.998],[1237.33,908.777]],[[1337.495,960.126],[1359.09,951.488],[1302.943,911.177],[1248.236,957.246],[1219.443,950.048],[1239.598,909.738]],[[1339.134,961.242],[1360.749,951.155],[1304.551,909.367],[1249.793,956.919],[1220.974,949.714],[1241.147,909.367]],[[1341.212,960.572],[1362.84,950.479],[1306.607,908.664],[1251.815,956.247],[1222.977,947.595],[1241.722,908.664]],[[1342.038,959.33],[1365.03,949.271],[1307.55,909.036],[1254.382,957.893],[1224.205,950.708],[1244.323,909.036]],[[1343.619,959.541],[1366.597,949.488],[1309.153,909.277],[1256.017,958.105],[1225.859,949.488],[1245.964,909.277]],[[1345.065,960.409],[1368.073,950.343],[1311.991,908.641],[1257.346,957.533],[1227.148,948.905],[1248.718,910.079]],[[1348.032,960.447],[1369.526,950.416],[1313.64,908.86],[1260.62,959.014],[1230.527,950.416],[1250.589,908.86]],[[1350.316,961.37],[1373.261,951.331],[1317.332,909.743],[1261.403,958.501],[1232.722,949.897],[1254.233,908.309]],[[1354.676,962.816],[1376.251,952.748],[1318.717,909.597],[1265.498,958.501],[1235.293,951.309],[1255.43,909.597]],[[1355.563,963.195],[1378.603,953.114],[1321.003,909.914],[1266.282,957.435],[1237.482,950.234],[1257.642,908.474]],[[1356.783,962.187],[1379.832,952.103],[1323.651,908.886],[1268.91,956.424],[1240.099,949.222],[1258.826,906.005]],[[1359.912,962.994],[1382.94,952.919],[1325.371,911.181],[1273.558,955.798],[1244.773,948.602],[1262.044,906.864]],[[1361.739,962.755],[1384.813,952.66],[1328.571,910.839],[1280.981,955.545],[1250.697,949.776],[1265.118,905.071]],[[1364.452,963.351],[1387.497,953.269],[1331.326,910.06],[1283.796,954.709],[1253.55,948.948],[1266.512,905.739]],[[1366.753,963.752],[1389.813,955.105],[1335.046,910.426],[1286.043,955.105],[1257.218,947.899],[1271.631,906.103]],[[1369.957,963.571],[1392.994,954.932],[1336.841,911.738],[1289.328,953.492],[1259.092,947.733],[1273.49,904.539]],[[1373.101,965.508],[1396.186,956.852],[1338.474,913.567],[1292.304,956.852],[1262.005,949.638],[1277.876,906.353]],[[1375.516,966.573],[1397.15,957.919],[1342.343,913.208],[1294.747,956.476],[1264.459,949.265],[1277.44,907.439]],[[1377.875,966.588],[1399.506,957.936],[1344.708,914.674],[1297.12,955.052],[1268.279,949.283],[1279.815,907.463]],[[1381.576,967.703],[1401.742,957.62],[1345.565,915.847],[1298.031,956.18],[1269.222,950.418],[1280.746,907.205]],[[1383.143,967.981],[1401.865,957.9],[1348.58,914.696],[1301.055,957.9],[1270.812,952.14],[1283.773,910.376]],[[1384.2,967.252],[1404.353,957.176],[1351.092,913.991],[1302.149,958.615],[1273.359,951.418],[1284.875,909.672]],[[1386.859,970.014],[1407.052,958.475],[1353.686,915.206],[1304.647,958.475],[1274.358,952.706],[1288.781,910.879]],[[1389.574,971.481],[1409.754,959.95],[1353.537,915.265],[1305.969,959.95],[1275.698,952.743],[1291.554,912.382]],[[1391.943,971.987],[1412.077,960.482],[1353.115,914.462],[1307.095,961.92],[1276.895,956.168],[1292.714,913.024]],[[1391.536,971.22],[1413.068,959.737],[1355.649,905.188],[1309.713,962.608],[1278.133,955.43],[1293.923,912.366]],[[1394.617,972.695],[1414.609,959.843],[1356.061,899.867],[1311.792,961.271],[1278.948,956.987],[1294.656,909.863]],[[1396.022,974.43],[1414.528,960.194],[1353.316,890.44],[1314.88,960.194],[1282.138,957.347],[1294.95,908.947]],[[1392.55,972.786],[1410.928,957.235],[1350.14,883.724],[1316.212,961.476],[1283.697,958.649],[1296.42,909.17]],[[1378.975,970.242],[1400.195,958.925],[1346.437,879.703],[1316.729,964.584],[1282.777,960.34],[1295.509,910.826]],[[1354.562,968.353],[1381.399,958.466],[1341.849,882.191],[1317.837,962.703],[1283.937,959.878],[1296.65,914.678]],[[1339.173,953.272],[1366.085,944.773],[1330.674,885.283],[1319.343,967.436],[1286.765,961.771],[1295.263,913.611]],[[1307.396,962.627],[1333.03,959.779],[1318.789,897.119],[1304.548,972.596],[1278.915,965.475],[1294.58,912.784]],[[1274.213,975.136],[1304.288,973.704],[1307.153,927.875],[1282.806,976.568],[1262.756,969.407],[1298.56,927.875]],[[1308.337,969.596],[1324.155,965.282],[1263.759,910.638],[1250.817,972.472],[1237.875,966.72],[1309.775,923.58]],[[1202.366,985.164],[1226.831,986.603],[1242.661,913.209],[1320.372,960.699],[1288.712,959.26],[1304.542,916.087]],[[1186.593,987.649],[1211.265,990.552],[1228.681,932.499],[1321.565,961.526],[1291.088,961.526],[1302.698,917.986]],[[1179.998,998.442],[1206.123,996.991],[1207.575,936.031],[1317.883,962.157],[1287.403,962.157],[1312.077,925.871]],[[1179.979,1004.583],[1208.854,1000.252],[1190.086,938.171],[1318.579,965.602],[1286.816,962.714],[1312.804,923.733]],[[1180.911,1007.478],[1211.137,1000.281],[1180.911,945.587],[1317.646,968.616],[1287.421,965.738],[1313.328,918.24]],[[1179.763,1008.292],[1211.318,999.686],[1179.763,948.05],[1317.459,969.565],[1287.338,966.697],[1314.59,915.061]],[[1179.496,1008.14],[1210.963,999.558],[1186.647,952.357],[1318.236,972.382],[1286.769,968.091],[1311.084,910.878]],[[1179.89,1008.523],[1211.195,1001.408],[1191.274,955.874],[1317.915,971.526],[1289.456,970.103],[1302.263,900.379]],[[1180.135,1007.268],[1211.493,1001.566],[1192.963,955.955],[1312.693,970.208],[1287.036,967.358],[1294.163,890.389]],[[1179.296,1007.414],[1210.492,1003.16],[1193.476,957.785],[1301.241,962.039],[1277.136,956.367],[1272.882,868.453]],[[1177.943,1008.957],[1210.259,1003.336],[1193.398,958.374],[1267.867,956.969],[1242.576,945.729],[1262.247,852.994]],[[1177.375,1010.658],[1209.584,1003.657],[1195.58,953.244],[1243.192,944.841],[1224.988,936.439],[1240.392,862.22]],[[1176.275,1009.469],[1209.702,1003.898],[1195.774,953.757],[1192.988,898.046],[1179.06,896.653],[1179.06,821.442]],[[1178.276,1008.884],[1211.61,1006.106],[1192.165,953.328],null,null,[1151.887,813.05]],[[1179.025,1008.391],[1209.546,1004.229],[1194.285,952.898],null,null,[1111.045,812.777]],[[1176.89,1008.215],[1211.334,1002.704],[1190.668,954.482],null,null,[1065.291,831.861]],[[1178.289,1009.935],[1209.808,1004.454],[1189.253,956.49],null,null,[1019.324,853.71]],[[1177.444,1008.964],[1211.611,1002.131],[1187.011,955.664],[909.574,967.964],[894.541,950.197],[962.875,881.863]],[[1179.783,1006.264],[1211.182,999.438],[1186.609,955.752],[872.616,968.039],[852.138,951.657],[912.206,905.241]],[[1181.174,1006.98],[1212.464,1000.178],[1182.535,955.284],[824.74,978.411],[808.415,959.365],[864.193,923.994]],[[1180.401,1004.845],[1212.15,996.563],[1181.782,955.152],[786.996,985.52],[767.67,966.195],[824.266,922.023]],[[1181.587,1003.423],[1213.337,996.207],[1180.144,951.468],[758.733,984.661],[739.972,961.57],[802.029,924.047]],[[1182.211,1005.515],[1213.972,995.409],[1180.767,950.655],[740.448,1004.071],[727.455,978.085],[792.42,929.0]],[[1182.997,1004.568],[1214.276,996.037],[1177.31,950.541],[745.097,1004.568],[728.036,986.085],[792.015,933.48]],[[1183.482,1004.227],[1214.2,994.453],[1180.689,952.565],[740.861,1004.227],[729.69,988.868],[807.882,946.98]],[[1183.024,1002.532],[1213.153,990.207],[1174.807,947.751],[740.667,1005.271],[731.08,990.207],[817.36,960.077]],[[1190.953,1001.808],[1211.099,988.378],[1160.064,948.087],[741.039,1004.494],[731.638,988.378],[814.906,958.831]],[[1190.558,1001.414],[1209.941,985.907],[1162.129,947.14],[739.569,1003.999],[730.523,987.2],[813.226,957.478]],[[1188.057,1002.536],[1211.58,986.854],[1171.068,934.581],[739.815,1003.843],[728.053,986.854],[811.69,951.57]],[[1186.792,1001.975],[1212.034,983.375],[1185.463,903.663],[739.075,999.318],[729.775,984.704],[812.144,948.833]],[[1185.572,993.237],[1209.814,971.688],[1186.919,873.375],[738.447,997.277],[731.713,982.462],[812.519,946.1]],[[1167.899,976.79],[1187.802,959.73],[1182.116,860.216],[737.144,995.271],[731.457,981.055],[813.912,945.514]],[[1118.986,990.345],[1140.108,975.258],[1150.67,875.68],[728.219,990.345],[726.71,975.258],[812.709,945.083]],[[1120.296,991.094],[1141.405,974.508],[1139.897,873.487],[716.21,986.57],[717.718,973.0],[814.216,947.368]],[[1122.784,992.929],[1142.692,976.084],[1138.098,875.011],[716.962,985.272],[716.962,973.021],[814.972,948.519]],[[1124.996,992.583],[1147.737,979.588],[1149.362,880.5],[717.272,984.461],[717.272,973.09],[814.736,945.475]],[[1124.881,991.099],[1149.703,982.826],[1166.251,889.055],[718.082,984.205],[720.84,973.173],[814.611,945.593]],[[1129.54,987.888],[1154.204,982.407],[1181.608,893.344],[718.478,982.407],[722.589,971.446],[817.133,946.782]],[[1131.259,986.484],[1155.638,983.233],[1189.768,897.094],[716.814,981.608],[721.69,973.481],[819.206,944.227]],[[1132.827,985.424],[1158.259,982.245],[1193.227,899.592],[717.973,979.066],[722.741,969.529],[819.7,942.508]],[[1132.002,986.903],[1158.092,983.642],[1197.226,902.112],[719.463,980.38],[725.985,970.597],[822.19,942.877]],[[1132.671,985.073],[1157.458,985.073],[1199.742,906.337],[717.117,980.699],[720.033,973.409],[822.099,942.789]],[[1132.306,983.242],[1161.702,985.202],[1204.817,906.812],[720.758,981.282],[724.677,969.524],[822.665,942.087]],[[1137.058,985.527],[1164.832,987.511],[1210.462,912.122],[722.42,981.559],[724.404,971.639],[823.6,941.881]],[[1130.87,984.908],[1162.497,991.233],[1213.1,915.329],[723.939,980.691],[723.939,970.149],[825.145,942.739]],[[1131.65,982.456],[1160.719,990.761],[1216.781,916.012],[720.533,980.379],[724.686,969.998],[826.427,940.929]],[[1136.843,981.595],[1162.38,987.067],[1217.102,919.576],[720.957,981.595],[726.429,970.65],[823.104,943.289]],[[1135.5,982.453],[1162.768,990.473],[1217.305,921.501],[716.852,979.245],[724.872,969.621],[824.321,940.749]],[[1139.056,984.023],[1164.302,991.913],[1217.948,924.065],[719.348,979.29],[725.66,969.823],[825.064,941.421]],[[1141.148,985.1],[1164.712,994.526],[1218.123,925.405],[718.567,981.958],[724.851,970.962],[826.961,941.114]],[[1148.43,984.791],[1169.089,989.956],[1220.738,924.534],[718.024,983.069],[724.911,971.018],[824.765,943.472]],[[1142.354,985.173],[1166.629,990.775],[1220.782,925.419],[720.338,983.306],[725.94,970.235],[826.776,944.092]],[[1148.042,987.381],[1169.765,990.723],[1219.894,925.554],[718.598,982.368],[725.282,972.342],[825.541,943.935]],[[1146.457,991.8],[1169.662,995.668],[1219.939,926.054],[721.037,984.065],[724.905,972.463],[825.459,943.457]],[[1143.995,985.758],[1168.624,991.441],[1221.671,925.132],[721.512,981.969],[727.196,972.496],[825.712,944.078]],[[1148.029,990.767],[1172.298,998.234],[1224.568,925.429],[722.402,985.166],[726.135,973.965],[825.075,944.097]],[[1143.642,986.197],[1167.445,995.352],[1226.039,927.603],[720.669,984.366],[726.162,973.379],[823.208,944.083]],[[1140.553,981.349],[1162.85,995.071],[1228.027,929.894],[720.336,984.78],[725.481,974.489],[824.961,943.616]],[[1139.444,983.623],[1163.822,995.812],[1229.989,931.386],[718.065,987.106],[723.288,976.659],[824.28,943.575]],[[1142.831,983.158],[1167.337,995.411],[1230.353,930.645],[715.722,988.41],[722.723,979.657],[826.0,944.648]],[[1143.325,985.257],[1167.782,993.992],[1234.164,931.103],[717.079,988.751],[722.32,980.017],[827.135,943.331]],[[1142.039,978.77],[1163.768,987.824],[1236.197,933.502],[716.515,987.824],[723.758,976.96],[830.592,946.177]],[[1143.131,980.842],[1165.093,989.993],[1234.638,933.259],[718.543,988.163],[724.034,979.012],[833.841,947.9]],[[1141.416,980.261],[1166.335,989.845],[1235.341,932.34],[729.296,999.43],[735.047,986.012],[836.639,951.509]],[[1141.677,984.399],[1169.131,990.282],[1231.883,925.569],[747.516,1013.814],[747.516,1000.087],[841.644,953.023]],[[1141.561,987.674],[1173.113,991.618],[1228.329,922.598],[743.215,1017.254],[743.215,1001.478],[843.787,962.038]],[[1141.655,983.13],[1170.801,987.016],[1223.262,920.953],[745.279,1018.104],[745.279,1002.56],[846.316,965.642]],[[1148.95,990.698],[1174.917,990.698],[1212.013,918.362],[742.753,1016.665],[746.462,1005.536],[846.621,974.005]],[[1143.18,986.528],[1169.376,986.528],[1203.056,907.941],[742.76,1018.337],[744.631,1005.239],[847.543,969.688]],[[1142.407,989.574],[1166.088,982.287],[1187.947,900.314],[745.292,1020.541],[743.47,1007.79],[847.303,969.536]],[[1137.599,991.75],[1160.559,982.919],[1174.689,887.545],[743.74,1021.775],[741.974,1009.412],[846.179,968.79]],[[1134.292,991.86],[1156.717,976.336],[1156.717,874.561],[744.446,1021.185],[742.721,1009.11],[844.495,969.436]],[[1130.089,989.593],[1149.187,972.231],[1138.77,864.587],[744.654,1022.58],[741.182,1010.427],[847.09,968.759]],[[1111.753,987.045],[1130.49,968.308],[1118.566,860.995],[745.526,1022.816],[742.119,1009.189],[846.025,968.308]]],"conf_extra":[[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0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.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0],[1.0,1.0,1.0,1.0,1.0,1.0]],"box":[[1180.038,96.891,1483.416,976.776],[1184.0,95.996,1490.389,976.974],[1186.98,96.991,1497.713,977.602],[1188.846,96.532,1503.121,977.483],[1190.374,98.222,1506.524,977.997],[1192.457,97.077,1507.547,977.44],[1193.033,95.607,1508.171,977.461],[1196.828,95.439,1507.67,978.015],[1198.503,96.042,1508.16,980.569],[1200.553,94.926,1506.534,980.263],[1202.197,95.151,1506.181,981.047],[1205.38,96.852,1495.94,979.735],[1208.081,97.594,1496.39,979.933],[1209.84,97.313,1503.299,980.829],[1212.435,100.371,1500.824,980.795],[1215.138,99.207,1505.57,980.299],[1217.75,96.646,1511.738,980.364],[1219.667,96.02,1511.619,980.763],[1221.868,96.131,1508.985,981.202],[1223.17,97.719,1513.926,981.992],[1225.001,97.202,1512.898,983.233],[1225.526,97.446,1520.662,982.362],[1225.455,97.275,1519.581,982.777],[1225.506,97.956,1523.047,982.576],[1225.148,98.091,1526.826,984.554],[1224.215,98.025,1526.816,984.168],[1222.889,98.178,1527.094,984.181],[1220.309,98.835,1525.557,983.836],[1218.063,100.726,1525.181,985.551],[1216.123,101.825,1523.488,986.254],[1212.903,102.892,1520.43,989.053],[1208.388,103.435,1515.984,989.067],[1204.172,105.958,1510.686,989.532],[1200.454,106.772,1505.102,988.733],[1195.419,111.318,1502.422,988.689],[1191.459,114.32,1495.243,988.95],[1186.799,118.641,1493.689,987.205],[1183.036,116.909,1484.374,986.087],[1179.006,119.166,1482.093,986.998],[1174.358,121.536,1478.492,991.799],[1171.254,123.555,1474.869,998.514],[1167.386,124.16,1472.697,1004.065],[1163.573,125.203,1467.481,1008.71],[1157.371,127.175,1463.225,1011.356],[1153.12,128.179,1460.984,1019.869],[1147.977,131.654,1452.954,1023.407],[1141.983,136.603,1448.975,1023.64],[1137.171,140.724,1443.428,1025.037],[1131.48,144.536,1440.327,1025.791],[1124.651,148.237,1437.445,1027.02],[1115.819,153.051,1428.943,1027.306],[1106.156,154.621,1422.306,1030.358],[1089.505,157.771,1419.392,1028.967],[1082.946,165.636,1413.446,1028.908],[1069.344,168.761,1408.638,1029.143],[1057.841,173.515,1406.132,1029.247],[1041.908,173.882,1406.312,1027.217],[1024.01,175.714,1406.181,1028.091],[1002.446,181.279,1406.445,1027.779],[965.11,184.684,1405.173,1026.654],[891.974,185.948,1405.514,1025.638],[849.654,185.514,1403.427,1024.285],[795.687,189.087,1395.247,1024.938],[757.456,190.682,1393.53,1026.677],[722.076,193.902,1387.097,1024.962],[713.884,197.393,1379.128,1031.167],[716.093,197.032,1371.237,1030.139],[716.565,196.076,1359.972,1027.668],[716.837,201.518,1347.915,1028.394],[716.327,212.404,1335.194,1028.373],[717.553,233.57,1312.076,1027.517],[716.596,224.712,1262.242,1027.628],[718.707,211.229,1235.059,1027.483],[715.955,198.377,1234.999,1025.828],[688.893,169.017,1234.631,1042.47],[645.904,148.16,1199.792,1075.137],[617.645,150.957,1215.845,1077.339],[616.277,136.569,1221.937,1077.463],[625.215,80.971,1231.673,1079.001],[694.298,173.089,1194.172,1020.334],[691.968,175.081,1213.599,1016.936],[629.692,80.882,1265.514,1079.449],[651.968,102.945,1260.821,1079.521],[636.401,68.554,1369.97,1070.389],[691.746,142.952,1363.631,1016.501],[592.59,69.999,1495.644,1080.0],[594.656,82.656,1508.843,1078.962],[577.612,76.148,1549.187,1079.805],[584.74,77.641,1541.522,1080.0],[634.496,133.941,1475.024,1048.55],[701.774,151.553,1440.904,1014.554],[706.094,153.827,1433.167,1012.673],[702.229,152.743,1426.115,1016.282],[643.306,137.864,1436.629,1043.216],[613.154,104.326,1473.617,1070.54],[657.774,141.725,1427.765,1030.962],[598.439,89.069,1489.5,1078.5],[599.504,91.335,1472.508,1076.895],[594.713,83.566,1454.929,1076.58],[595.425,61.178,1439.173,1076.257],[600.444,22.225,1389.083,1076.027],[601.755,6.441,1367.193,1076.257],[593.061,0.807,1335.509,1076.282],[561.745,0.0,1337.092,1071.205],[511.177,0.0,1345.566,1075.336],[503.687,21.491,1347.007,1080.0],[467.839,61.338,1351.118,1078.778],[440.815,69.792,1344.445,1079.307],[432.82,63.445,1341.523,1079.714],[435.561,68.02,1330.906,1070.511],[452.664,42.541,1307.349,1059.687],[444.503,0.0,1306.716,1072.03],[454.925,7.798,1294.33,1078.752],[492.479,0.0,1277.591,1078.646],[529.414,11.724,1242.375,1071.555],[476.158,10.034,1238.855,1076.75],[446.359,27.702,1225.251,1074.259]],"track_id":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"people_count":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"blur":[0.319,0.348,0.357,0.377,0.341,0.383,0.376,0.383,0.352,0.395,0.383,0.398,0.362,0.416,0.399,0.407,0.371,0.411,0.412,0.437,0.382,0.429,0.42,0.43,0.4,0.428,0.403,0.411,0.383,0.394,0.356,0.368,0.344,0.376,0.362,0.374,0.357,0.381,0.369,0.376,0.355,0.38,0.361,0.37,0.362,0.377,0.369,0.373,0.347,0.371,0.364,0.373,0.357,0.378,0.369,0.374,0.354,0.371,0.359,0.366,0.334,0.344,0.324,0.352,0.341,0.351,0.331,0.358,0.349,0.357,0.338,0.368,0.357,0.362,0.341,0.367,0.359,0.361,0.344,0.367,0.369,0.378,0.349,0.384,0.372,0.389,0.359,0.384,0.368,0.382,0.346,0.364,0.373,0.392,0.361,0.395,0.384,0.401,0.366,0.398,0.376,0.402,0.37,0.413,0.393,0.411,0.374,0.416,0.394,0.417,0.378,0.406,0.382,0.409,0.384,0.419,0.415],"brightness":[95.153,95.463,95.647,95.98,95.674,96.107,96.014,96.2,95.734,96.3,96.327,96.558,96.344,96.852,96.758,96.918,96.521,96.984,97.058,97.331,97.011,97.469,97.371,97.44,97.115,97.354,97.133,97.274,96.974,97.299,97.249,97.415,97.297,97.782,97.695,97.91,97.801,98.173,98.173,98.346,98.063,98.328,98.114,98.303,98.014,98.384,98.449,98.514,98.301,98.722,98.681,98.789,98.503,98.762,98.708,98.725,98.299,98.247,97.906,97.769,97.388,97.374,97.025,97.236,97.075,97.025,96.724,96.841,96.513,96.673,96.331,96.854,97.761,97.499,97.602,98.484,97.851,97.382,96.006,95.651,94.905,95.447,96.062,96.971,97.098,97.119,96.774,96.963,96.821,96.72,96.309,96.167,96.059,96.066,95.883,96.177,96.305,96.583,96.336,96.293,95.925,95.943,95.526,95.314,95.07,95.507,95.72,96.243,96.125,96.29,96.098,96.572,96.695,97.176,97.102,97.302,97.116]}}}
|
tests/test_2d_regressions.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Regressions for the supplied walkthrough run; these are not accuracy tests."""
|
| 2 |
+
from copy import deepcopy
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
import numpy as np
|
| 6 |
+
import pytest
|
| 7 |
+
from baseball_batting.api_contract import AnalysisInput
|
| 8 |
+
from baseball_batting.batting_measurements import analyze_batting, capture_checks, point_array
|
| 9 |
+
from baseball_batting.body2d import filter_implausible_feet
|
| 10 |
+
from baseball_batting.detection import relevant_people
|
| 11 |
+
from test_batting_measurements import swing_track, options, metric_map
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@pytest.fixture
|
| 15 |
+
def walkthrough():
|
| 16 |
+
# Only numeric model observations are included; no player images or truth
|
| 17 |
+
# measurements. Assertions catch the reviewed failure modes, not accuracy.
|
| 18 |
+
record = json.loads((Path(__file__).parent / "fixtures/walkthrough_pose.json").read_text())
|
| 19 |
+
return record["track"]
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def test_detached_toes_are_rejected_without_fabricating_replacements():
|
| 23 |
+
points = np.zeros((133, 2), float)
|
| 24 |
+
points[13:17] = [[200, 400], [300, 400], [200, 600], [300, 600]]
|
| 25 |
+
points[17:23] = [[220, 630], [225, 625], [190, 615],
|
| 26 |
+
[310, 100], [310, 230], [290, 615]]
|
| 27 |
+
scores = np.full(133, .9)
|
| 28 |
+
original = points.copy()
|
| 29 |
+
filtered, confidence = filter_implausible_feet(points, scores)
|
| 30 |
+
assert np.isnan(filtered[20:22]).all() and (confidence[20:22] == 0).all()
|
| 31 |
+
np.testing.assert_array_equal(filtered[17:20], points[17:20])
|
| 32 |
+
np.testing.assert_array_equal(filtered[22], points[22])
|
| 33 |
+
np.testing.assert_array_equal(filtered[:17], points[:17])
|
| 34 |
+
np.testing.assert_array_equal(points, original)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def test_small_background_hit_does_not_count_as_another_athlete():
|
| 38 |
+
athlete = {"class_id": 0, "box": [700, 190, 1400, 1030], "score": .94}
|
| 39 |
+
background = {"class_id": 0, "box": [1580, 400, 1675, 495], "score": .58}
|
| 40 |
+
other_person = {"class_id": 0, "box": [50, 200, 300, 1000], "score": .9}
|
| 41 |
+
assert relevant_people([athlete, background], athlete, 1080) == 1
|
| 42 |
+
assert relevant_people([athlete, background, other_person], athlete, 1080) == 2
|
| 43 |
+
small = {"class_id": 0, "box": [50, 30, 100, 100], "score": .9}
|
| 44 |
+
assert relevant_people([small], small, 1080) == 1 # reject small capture separately
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def test_loose_border_box_is_not_a_cropped_body():
|
| 48 |
+
track = swing_track()
|
| 49 |
+
track["frames"]["box"] = [[0, 0, 1280, 720]]*180
|
| 50 |
+
capture, _ = capture_checks(track, options(), 400, range(180))
|
| 51 |
+
assert capture == {"ok": True, "reasons": []}
|
| 52 |
+
for frame in track["frames"]["kp"]:
|
| 53 |
+
frame[15] = [370, 715]
|
| 54 |
+
capture, _ = capture_checks(track, options(), 400, range(180))
|
| 55 |
+
assert "partly_out_of_frame" in capture["reasons"]
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def test_walkthrough_keeps_preparation_and_follow_through(walkthrough):
|
| 59 |
+
original = deepcopy(walkthrough)
|
| 60 |
+
pose, reps, capture, _, method = analyze_batting(walkthrough, AnalysisInput(handedness="right"))
|
| 61 |
+
assert walkthrough == original
|
| 62 |
+
assert len(pose) == len(reps) == 1
|
| 63 |
+
assert pose[0]["start_frame"] < 40 # preparation was lost at frame 65 before
|
| 64 |
+
assert pose[0]["end_frame"] == 116
|
| 65 |
+
assert capture == {"ok": False, "reasons": ["view_uncertain"]}
|
| 66 |
+
assert method["pitcher_direction"] is None # inconsistent ankle/drive directions
|
| 67 |
+
assert 69 <= pose[0]["events"]["swing_start"]["frame"] <= 74
|
| 68 |
+
assert "finish" not in pose[0]["events"] # the recording ends before settling
|
| 69 |
+
assert reps[0]["events_ms"] == {} # physical capture clock remains unknown
|
| 70 |
+
assert all(m["value"] is None for m in reps[0]["metrics"])
|
| 71 |
+
body = point_array(walkthrough["frames"]["kp"], 17)
|
| 72 |
+
feet = point_array(walkthrough["frames"]["kp_extra"], 6)
|
| 73 |
+
for ankle, ids in ((15, slice(0, 3)), (16, slice(3, 6))):
|
| 74 |
+
distance = np.linalg.norm(feet[:, ids]-body[:, ankle, None], axis=2)
|
| 75 |
+
assert np.nanmax(distance) < 160 # old toes were roughly 780 px from ankles
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def test_known_view_on_moving_camera_keeps_only_supported_numbers(walkthrough):
|
| 79 |
+
opt = AnalysisInput(view="face_on", handedness="left", pitcher_direction="image_left",
|
| 80 |
+
camera_stability="moving")
|
| 81 |
+
pose, reps, capture, _, _ = analyze_batting(walkthrough, opt)
|
| 82 |
+
assert capture == {"ok": True, "reasons": []}
|
| 83 |
+
assert 73 <= pose[0]["events"]["contact"]["frame"] <= 78 # proxy, not labeled ball contact
|
| 84 |
+
assert "foot_plant" not in pose[0]["events"] and "finish" not in pose[0]["events"]
|
| 85 |
+
metrics = metric_map(reps[0])
|
| 86 |
+
assert metrics["com_drift_pct_height"]["value"] is not None
|
| 87 |
+
assert metrics["lead_knee_angle_contact_deg"]["value"] is not None
|
| 88 |
+
for key in ("stride_pct_height", "head_movement_pct_height", "foot_plant_to_contact_ms",
|
| 89 |
+
"load_tempo_s", "load_launch_ratio", "lateral_trunk_tilt_contact_deg",
|
| 90 |
+
"hip_shoulder_separation_foot_plant_deg"):
|
| 91 |
+
assert metrics[key]["value"] is None and metrics[key]["note"]
|
| 92 |
+
assert all(m["confidence"] == "est" for m in metrics.values())
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
def test_conflicting_metadata_never_labels_the_back_leg_as_front(walkthrough):
|
| 96 |
+
opt = AnalysisInput(view="face_on", handedness="right", pitcher_direction="image_left",
|
| 97 |
+
camera_stability="moving")
|
| 98 |
+
_, reps, _, _, _ = analyze_batting(walkthrough, opt)
|
| 99 |
+
for key in ("com_drift_pct_height", "lead_knee_angle_contact_deg"):
|
| 100 |
+
metric = metric_map(reps[0])[key]
|
| 101 |
+
assert metric["value"] is None
|
| 102 |
+
assert "conflicts" in metric["note"]
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def test_translation_does_not_change_within_frame_body_measurements():
|
| 106 |
+
track = swing_track()
|
| 107 |
+
translated = deepcopy(track)
|
| 108 |
+
for i in range(180):
|
| 109 |
+
shift = np.array([i*1.2, i*.1])
|
| 110 |
+
for name in ("kp", "kp_extra"):
|
| 111 |
+
translated["frames"][name][i] = (np.asarray(track["frames"][name][i])+shift).tolist()
|
| 112 |
+
translated["frames"]["box"][i] = (np.asarray(track["frames"]["box"][i])+np.tile(shift, 2)).tolist()
|
| 113 |
+
opt = options(single_swing=True)
|
| 114 |
+
opt.camera_stability = "moving"
|
| 115 |
+
baseline = metric_map(analyze_batting(track, opt)[1][0])
|
| 116 |
+
shifted = metric_map(analyze_batting(translated, opt)[1][0])
|
| 117 |
+
for key in ("com_drift_pct_height", "lead_knee_angle_contact_deg", "load_tempo_s", "load_launch_ratio"):
|
| 118 |
+
assert shifted[key]["value"] == pytest.approx(baseline[key]["value"], abs=.01)
|
| 119 |
+
assert shifted["head_movement_pct_height"]["value"] is None
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
@pytest.mark.parametrize("fps", [30, 60, 120])
|
| 123 |
+
def test_loading_and_hand_return_do_not_become_extra_swings(fps):
|
| 124 |
+
pose, _, _, _, _ = analyze_batting(swing_track(fps=fps, repeats=2), options())
|
| 125 |
+
assert len(pose) == 2
|
| 126 |
+
assert pose[0]["end_frame"] < pose[1]["start_frame"]
|
| 127 |
+
assert pose[0]["start_frame"] < 25 and pose[1]["start_frame"] < 205
|
tests/test_api.py
CHANGED
|
@@ -236,7 +236,7 @@ def test_pose_handoff_real_decoding_raw_points_and_unknown_time(video, tmp_path,
|
|
| 236 |
assert frames["kp"][0][5] is None and frames["conf"][0][5] == 0
|
| 237 |
assert len(frames["kp"][0]) == 17 and len(frames["kp_extra"][0]) == 6
|
| 238 |
assert frames["kp_extra"][0][0] == [27., 27.]
|
| 239 |
-
assert frames["people_count"] == [
|
| 240 |
assert frames["t_s"] == [None] * 8 and frames["playback_t_s"][1] == pytest.approx(.033)
|
| 241 |
assert not result["measurements"]["capture"]["ok"]
|
| 242 |
assert result["pose_track"]["reps"][0]["events"] == {}
|
|
|
|
| 236 |
assert frames["kp"][0][5] is None and frames["conf"][0][5] == 0
|
| 237 |
assert len(frames["kp"][0]) == 17 and len(frames["kp_extra"][0]) == 6
|
| 238 |
assert frames["kp_extra"][0][0] == [27., 27.]
|
| 239 |
+
assert frames["people_count"] == [1] * 8 # tiny background proposal is not an athlete
|
| 240 |
assert frames["t_s"] == [None] * 8 and frames["playback_t_s"][1] == pytest.approx(.033)
|
| 241 |
assert not result["measurements"]["capture"]["ok"]
|
| 242 |
assert result["pose_track"]["reps"][0]["events"] == {}
|
tests/test_batting_measurements.py
CHANGED
|
@@ -137,7 +137,11 @@ def test_failed_capture_uses_only_coach_reason_keys_and_withholds_numbers(change
|
|
| 137 |
if change == "people": track["frames"]["people_count"] = [2]*180
|
| 138 |
if change == "dark": track["frames"]["brightness"] = [10]*180
|
| 139 |
if change == "blur": track["frames"]["blur"] = [.99]*180
|
| 140 |
-
if change == "crop":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
if change == "empty":
|
| 142 |
track["frames"]["box"] = [None]*180
|
| 143 |
track["frames"]["kp"] = [[None]*17 for _ in range(180)]
|
|
@@ -157,8 +161,13 @@ def test_absent_handedness_or_moving_camera_withholds_dependent_measurements():
|
|
| 157 |
opt = options(single_swing=True)
|
| 158 |
opt.camera_stability = "moving"
|
| 159 |
pose, reps, _, _, _ = analyze_batting(swing_track(), opt)
|
| 160 |
-
assert pose[0]["events"]
|
| 161 |
-
assert
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
def test_payload_is_measurements_only_and_preserves_level():
|
|
|
|
| 137 |
if change == "people": track["frames"]["people_count"] = [2]*180
|
| 138 |
if change == "dark": track["frames"]["brightness"] = [10]*180
|
| 139 |
if change == "blur": track["frames"]["blur"] = [.99]*180
|
| 140 |
+
if change == "crop":
|
| 141 |
+
track["frames"]["box"] = [[0,0,580,720]]*180
|
| 142 |
+
for frame, scores in zip(track["frames"]["kp"], track["frames"]["conf"]):
|
| 143 |
+
frame[15] = frame[16] = None
|
| 144 |
+
scores[15] = scores[16] = 0
|
| 145 |
if change == "empty":
|
| 146 |
track["frames"]["box"] = [None]*180
|
| 147 |
track["frames"]["kp"] = [[None]*17 for _ in range(180)]
|
|
|
|
| 161 |
opt = options(single_swing=True)
|
| 162 |
opt.camera_stability = "moving"
|
| 163 |
pose, reps, _, _, _ = analyze_batting(swing_track(), opt)
|
| 164 |
+
assert "contact" in pose[0]["events"]
|
| 165 |
+
assert "foot_plant" not in pose[0]["events"]
|
| 166 |
+
metrics = metric_map(reps[0])
|
| 167 |
+
assert metrics["stride_pct_height"]["value"] is None
|
| 168 |
+
assert metrics["head_movement_pct_height"]["value"] is None
|
| 169 |
+
assert metrics["lead_knee_angle_contact_deg"]["value"] is not None
|
| 170 |
+
assert metrics["com_drift_pct_height"]["value"] == pytest.approx(-25)
|
| 171 |
|
| 172 |
|
| 173 |
def test_payload_is_measurements_only_and_preserves_level():
|
tests/test_colab_2d.py
CHANGED
|
@@ -64,6 +64,9 @@ def test_swing_previews_preserve_inclusive_frames_and_variable_playback_timing(v
|
|
| 64 |
def test_preview_rotation_limit_and_raw_point_overlay(video, tmp_path):
|
| 65 |
result = preview_result(video, 90)
|
| 66 |
result["pose_track"]["frames"]["kp"][2][0] = [50, 70]
|
|
|
|
|
|
|
|
|
|
| 67 |
manifest = export_previews(video, result, tmp_path / "clips", max_clips=1)
|
| 68 |
assert manifest["swing_candidates_total"] == 2
|
| 69 |
assert len(manifest["previews"]) == 1
|
|
@@ -73,6 +76,8 @@ def test_preview_rotation_limit_and_raw_point_overlay(video, tmp_path):
|
|
| 73 |
frames = list(iter_frames(tmp_path / "clips" / record["file"]))
|
| 74 |
assert frames[0][3].shape[:2] == (160,120)
|
| 75 |
assert frames[0][3][70,50,1] > 150 # Visible raw nose point.
|
|
|
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
@pytest.mark.parametrize("bad_clock", [None, 0.0])
|
|
|
|
| 64 |
def test_preview_rotation_limit_and_raw_point_overlay(video, tmp_path):
|
| 65 |
result = preview_result(video, 90)
|
| 66 |
result["pose_track"]["frames"]["kp"][2][0] = [50, 70]
|
| 67 |
+
result["pose_track"]["frames"]["kp"][2][15] = [50, 70]
|
| 68 |
+
result["pose_track"]["frames"]["kp_extra"] = [[None]*6 for _ in range(8)]
|
| 69 |
+
result["pose_track"]["frames"]["kp_extra"][2][0] = [58, 80]
|
| 70 |
manifest = export_previews(video, result, tmp_path / "clips", max_clips=1)
|
| 71 |
assert manifest["swing_candidates_total"] == 2
|
| 72 |
assert len(manifest["previews"]) == 1
|
|
|
|
| 76 |
frames = list(iter_frames(tmp_path / "clips" / record["file"]))
|
| 77 |
assert frames[0][3].shape[:2] == (160,120)
|
| 78 |
assert frames[0][3][70,50,1] > 150 # Visible raw nose point.
|
| 79 |
+
foot = frames[0][3][80,58]
|
| 80 |
+
assert foot[2] > int(foot[1])+20 and foot[1] > 120 # Orange toe point.
|
| 81 |
|
| 82 |
|
| 83 |
@pytest.mark.parametrize("bad_clock", [None, 0.0])
|
tools/build_2d_notebook.py
CHANGED
|
@@ -86,7 +86,9 @@ if not preflight.get("ready") or preflight.get("device") != "cuda":
|
|
| 86 |
print(json.dumps(preflight, indent=2))
|
| 87 |
'''), markdown('''## 4. Upload a video and set its recording information
|
| 88 |
|
| 89 |
-
You can enter an existing `VIDEO_PATH` or leave it empty to upload. `HANDEDNESS`
|
|
|
|
|
|
|
| 90 |
|
| 91 |
Keep `TIMING={"kind":"unknown"}` unless capture timing is known. For an original unretimed recording use `{"kind":"unretimed","source":"original camera file; no retiming"}`. For documented constant slow motion use `{"kind":"constant_slowdown","source":"documented camera/export settings","factor":8,"all_captured_frames_retained":True}` with the real factor. Playback FPS is not capture FPS. Timing numbers require a known constant capture rate of at least 60 FPS.
|
| 92 |
|
|
@@ -96,7 +98,8 @@ import hashlib
|
|
| 96 |
import uuid
|
| 97 |
|
| 98 |
VIDEO_PATH = "" # Or, for example: "/content/IMG_1640.mp4"
|
| 99 |
-
HANDEDNESS =
|
|
|
|
| 100 |
VIEW = "unknown" # Change to "face_on" when known.
|
| 101 |
CAMERA_STABILITY = "unknown" # Change to "fixed_verified" when the camera stays still.
|
| 102 |
TIMING = {"kind": "unknown"}
|
|
@@ -113,6 +116,7 @@ source_video = Path(VIDEO_PATH).resolve()
|
|
| 113 |
if not source_video.is_file():
|
| 114 |
raise ValueError("VIDEO_PATH does not exist. Upload the video or correct its path.")
|
| 115 |
OPTIONS = {"discipline": "hitting", "handedness": HANDEDNESS, "view": VIEW,
|
|
|
|
| 116 |
"camera_stability": CAMERA_STABILITY, "timing": TIMING, "single_swing": SINGLE_SWING}
|
| 117 |
JOB_ROOT = WORKSPACE_ROOT / "results" / ("session-" + uuid.uuid4().hex[:12])
|
| 118 |
JOB_ROOT.mkdir(parents=True)
|
|
@@ -196,12 +200,15 @@ table(["Swing", "First frame", "Last frame (included)", "Video start (s)", "Vide
|
|
| 196 |
position(rep["end_frame"]), rep["boundary_method"]] for rep in track["reps"]])
|
| 197 |
for rep in result["measurements"]["reps"][:10]:
|
| 198 |
print("Swing", rep["rep"], "| estimated physical events_ms:", rep["events_ms"])
|
|
|
|
|
|
|
|
|
|
| 199 |
table(["Measurement", "Value", "Unit", "Confidence", "Explanation"],
|
| 200 |
[[m["key"], m["value"], m["unit"], m["confidence"], m["note"]] for m in rep["metrics"]])
|
| 201 |
print("Coach JSON:", JOB_ROOT / "coach-payload.json")
|
| 202 |
'''), markdown('''## 7. Watch previews of the detected swings
|
| 203 |
|
| 204 |
-
These inspection clips show
|
| 205 |
|
| 206 |
The default limit is ten clips; increase it up to 100 if needed. Inspect each range for missed preparation, truncated finish, merged swings or unrelated movements.
|
| 207 |
'''), code('''PREVIEW_LIMIT = 10
|
|
|
|
| 86 |
print(json.dumps(preflight, indent=2))
|
| 87 |
'''), markdown('''## 4. Upload a video and set its recording information
|
| 88 |
|
| 89 |
+
You can enter an existing `VIDEO_PATH` or leave it empty to upload. Set `HANDEDNESS` to the batter's own handedness when known. `PITCHER_DIRECTION` is the direction toward the pitcher/tee in the image: `"image_left"` or `"image_right"`. Leave it `None` if unknown. Cross-step drills can confuse automatic ankle ordering, so an explicit known direction helps.
|
| 90 |
+
|
| 91 |
+
Set `VIEW="face_on"` only for a known face-on recording. Unknown view keeps measurements empty, while ranges and generic motion events can still be inspected. Set `CAMERA_STABILITY="moving"` for a moving camera and `"fixed_verified"` only when the camera stays still. Moving/unknown cameras can still return within-frame body positions and projected knee angles when the required events are found. Ground-foot events and head movement require a fixed camera.
|
| 92 |
|
| 93 |
Keep `TIMING={"kind":"unknown"}` unless capture timing is known. For an original unretimed recording use `{"kind":"unretimed","source":"original camera file; no retiming"}`. For documented constant slow motion use `{"kind":"constant_slowdown","source":"documented camera/export settings","factor":8,"all_captured_frames_retained":True}` with the real factor. Playback FPS is not capture FPS. Timing numbers require a known constant capture rate of at least 60 FPS.
|
| 94 |
|
|
|
|
| 98 |
import uuid
|
| 99 |
|
| 100 |
VIDEO_PATH = "" # Or, for example: "/content/IMG_1640.mp4"
|
| 101 |
+
HANDEDNESS = None # Set to "right" or "left" when known.
|
| 102 |
+
PITCHER_DIRECTION = None # "image_left" or "image_right" toward the pitcher/tee, when known.
|
| 103 |
VIEW = "unknown" # Change to "face_on" when known.
|
| 104 |
CAMERA_STABILITY = "unknown" # Change to "fixed_verified" when the camera stays still.
|
| 105 |
TIMING = {"kind": "unknown"}
|
|
|
|
| 116 |
if not source_video.is_file():
|
| 117 |
raise ValueError("VIDEO_PATH does not exist. Upload the video or correct its path.")
|
| 118 |
OPTIONS = {"discipline": "hitting", "handedness": HANDEDNESS, "view": VIEW,
|
| 119 |
+
"pitcher_direction": PITCHER_DIRECTION,
|
| 120 |
"camera_stability": CAMERA_STABILITY, "timing": TIMING, "single_swing": SINGLE_SWING}
|
| 121 |
JOB_ROOT = WORKSPACE_ROOT / "results" / ("session-" + uuid.uuid4().hex[:12])
|
| 122 |
JOB_ROOT.mkdir(parents=True)
|
|
|
|
| 200 |
position(rep["end_frame"]), rep["boundary_method"]] for rep in track["reps"]])
|
| 201 |
for rep in result["measurements"]["reps"][:10]:
|
| 202 |
print("Swing", rep["rep"], "| estimated physical events_ms:", rep["events_ms"])
|
| 203 |
+
detected = next(p for p in track["reps"] if p["rep"] == rep["rep"])
|
| 204 |
+
table(["Estimated moment", "Video frame", "Video position (s)"],
|
| 205 |
+
[[key, event["frame"], position(event["frame"])] for key, event in detected["events"].items()])
|
| 206 |
table(["Measurement", "Value", "Unit", "Confidence", "Explanation"],
|
| 207 |
[[m["key"], m["value"], m["unit"], m["confidence"], m["note"]] for m in rep["metrics"]])
|
| 208 |
print("Coach JSON:", JOB_ROOT / "coach-payload.json")
|
| 209 |
'''), markdown('''## 7. Watch previews of the detected swings
|
| 210 |
|
| 211 |
+
These inspection clips show body points in green, toe/heel points in orange, and estimated event labels. They preserve playback presentation positions relative to each clip's first frame. They are resized to at most 960 pixels wide, have no audio, and are separate from the API's measurement output. Preview rendering does not alter measurement results. Invalid source timestamps cause a preview to be withheld rather than retimed.
|
| 212 |
|
| 213 |
The default limit is ten clips; increase it up to 100 if needed. Inspect each range for missed preparation, truncated finish, merged swings or unrelated movements.
|
| 214 |
'''), code('''PREVIEW_LIMIT = 10
|
tools/preview_swing_ranges.py
CHANGED
|
@@ -10,7 +10,7 @@ from baseball_batting.reports import BODY_EDGES
|
|
| 10 |
from baseball_batting.storage import atomic_json, read_json, sha256_file
|
| 11 |
|
| 12 |
|
| 13 |
-
def draw_points(image, points, rep, index, events):
|
| 14 |
import cv2
|
| 15 |
image = image.copy()
|
| 16 |
for a, b in BODY_EDGES:
|
|
@@ -20,6 +20,14 @@ def draw_points(image, points, rep, index, events):
|
|
| 20 |
for point in points:
|
| 21 |
if point is not None:
|
| 22 |
cv2.circle(image, tuple(np.rint(point).astype(int)), 3, (80, 230, 90), -1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
labels = [name for name, event in events.items() if event["frame"] == index]
|
| 24 |
text = f"Swing candidate {rep} | frame {index}"
|
| 25 |
if labels: text += " | estimated " + ", ".join(labels)
|
|
@@ -75,7 +83,8 @@ def export_previews(video, result, destination, max_clips=10, overlay=True):
|
|
| 75 |
if pts is None or abs(float(pts*base)-times[index-start]) > float(base)+1e-6:
|
| 76 |
raise ValueError("Source playback timestamps differ from the analysis")
|
| 77 |
if overlay:
|
| 78 |
-
|
|
|
|
| 79 |
scale = min(1., 960/info["width"])
|
| 80 |
width = max(2, 2*int(info["width"]*scale/2))
|
| 81 |
height = max(2, 2*int(info["height"]*scale/2))
|
|
|
|
| 10 |
from baseball_batting.storage import atomic_json, read_json, sha256_file
|
| 11 |
|
| 12 |
|
| 13 |
+
def draw_points(image, points, rep, index, events, extra_points=None):
|
| 14 |
import cv2
|
| 15 |
image = image.copy()
|
| 16 |
for a, b in BODY_EDGES:
|
|
|
|
| 20 |
for point in points:
|
| 21 |
if point is not None:
|
| 22 |
cv2.circle(image, tuple(np.rint(point).astype(int)), 3, (80, 230, 90), -1)
|
| 23 |
+
if extra_points is not None:
|
| 24 |
+
for j, point in enumerate(extra_points):
|
| 25 |
+
if point is None: continue
|
| 26 |
+
pixel = tuple(np.rint(point).astype(int))
|
| 27 |
+
ankle = points[15 if j < 3 else 16]
|
| 28 |
+
if ankle is not None:
|
| 29 |
+
cv2.line(image, tuple(np.rint(ankle).astype(int)), pixel, (0, 180, 255), 2)
|
| 30 |
+
cv2.circle(image, pixel, 4, (0, 180, 255), -1)
|
| 31 |
labels = [name for name, event in events.items() if event["frame"] == index]
|
| 32 |
text = f"Swing candidate {rep} | frame {index}"
|
| 33 |
if labels: text += " | estimated " + ", ".join(labels)
|
|
|
|
| 83 |
if pts is None or abs(float(pts*base)-times[index-start]) > float(base)+1e-6:
|
| 84 |
raise ValueError("Source playback timestamps differ from the analysis")
|
| 85 |
if overlay:
|
| 86 |
+
feet = frames["kp_extra"][index] if "kp_extra" in frames else None
|
| 87 |
+
image = draw_points(image, frames["kp"][index], rep["rep"], index, rep["events"], feet)
|
| 88 |
scale = min(1., 960/info["width"])
|
| 89 |
width = max(2, 2*int(info["width"]*scale/2))
|
| 90 |
height = max(2, 2*int(info["height"]*scale/2))
|