baseball-engine / docs /api-result.schema.json
github-actions[bot]
Automated Deploy: 0f6712d462fa0d8a00c5bbc6cfffe99ab79b85d6
16459e8
Raw History Blame Contribute Delete
31.7 kB
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Baseball 2D GPU result", "type": "object", "required": [ "schema_version", "status", "pose_track", "measurements", "warnings", "capabilities", "validation", "coach_payload", "measurement_method" ], "additionalProperties": false, "properties": { "schema_version": { "const": "1.0" }, "status": { "const": "partial" }, "validation": { "const": "reference_validation_pending" }, "warnings": { "type": "array", "items": { "type": "string" } }, "capabilities": { "type": "object", "required": [ "gpu_2d", "body_3d", "automatic_rep_splitting", "automatic_events", "swing_metrics", "coaching", "pitching", "estimated_only" ], "properties": { "gpu_2d": { "const": true }, "body_3d": { "type": "boolean" }, "automatic_rep_splitting": { "const": true }, "automatic_events": { "const": true }, "swing_metrics": { "const": true }, "coaching": { "const": false }, "pitching": { "const": false }, "estimated_only": { "const": true } }, "additionalProperties": false }, "pose_track": { "type": "object", "additionalProperties": false, "required": [ "schema_version", "discipline", "view", "video", "model", "keypoint_order", "extra_keypoint_order", "frames", "reps" ], "properties": { "schema_version": { "const": "1.0" }, "discipline": { "const": "hitting" }, "view": { "enum": [ "face_on", "unknown" ] }, "video": { "type": "object", "additionalProperties": false, "required": [ "width", "height", "frame_count", "capture_fps", "playback_fps", "rotation_degrees_applied", "time_source" ], "properties": { "width": { "type": "integer", "minimum": 1 }, "height": { "type": "integer", "minimum": 1 }, "frame_count": { "type": "integer", "minimum": 1 }, "capture_fps": { "type": [ "number", "null" ], "exclusiveMinimum": 0 }, "playback_fps": { "type": [ "number", "null" ], "exclusiveMinimum": 0 }, "rotation_degrees_applied": { "enum": [ 0, 90, 180, 270 ] }, "time_source": { "enum": [ "unknown", "original_pts", "slowmo_rescaled", "explicit_capture_times" ] } } }, "model": { "type": "object", "required": [ "name", "version", "sha256", "person_detector", "person_detector_sha256", "processing", "people_rule", "blur_definition" ], "properties": { "name": { "const": "RTMW-x" }, "version": { "type": "string" }, "sha256": { "type": "string" }, "person_detector": { "type": "string" }, "person_detector_sha256": { "type": "string" }, "processing": { "type": "array", "items": { "type": "string" } }, "people_rule": { "type": "string" }, "blur_definition": { "type": "string" } }, "additionalProperties": false }, "keypoint_order": { "const": [ "nose", "left_eye", "right_eye", "left_ear", "right_ear", "left_shoulder", "right_shoulder", "left_elbow", "right_elbow", "left_wrist", "right_wrist", "left_hip", "right_hip", "left_knee", "right_knee", "left_ankle", "right_ankle" ] }, "extra_keypoint_order": { "const": [ "left_big_toe", "left_small_toe", "left_heel", "right_big_toe", "right_small_toe", "right_heel" ] }, "frames": { "type": "object", "additionalProperties": false, "required": [ "t_s", "playback_t_s", "kp", "conf", "kp_extra", "conf_extra", "box", "track_id", "people_count", "blur", "brightness" ], "properties": { "t_s": { "type": "array", "items": { "type": [ "number", "null" ] } }, "playback_t_s": { "type": "array", "items": { "type": [ "number", "null" ] } }, "kp": { "type": "array", "items": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "$ref": "#/$defs/point" } } }, "conf": { "type": "array", "items": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "$ref": "#/$defs/confidence" } } }, "kp_extra": { "type": "array", "items": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "$ref": "#/$defs/point" } } }, "conf_extra": { "type": "array", "items": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "$ref": "#/$defs/confidence" } } }, "box": { "type": "array", "items": { "type": [ "array", "null" ], "minItems": 4, "maxItems": 4, "items": { "type": "number" } } }, "track_id": { "type": "array", "items": { "enum": [ 1, null ] } }, "people_count": { "type": "array", "items": { "type": [ "integer", "null" ], "minimum": 0 } }, "blur": { "type": "array", "items": { "$ref": "#/$defs/confidence" } }, "brightness": { "type": "array", "items": { "type": "number", "minimum": 0, "maximum": 255 } } } }, "reps": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "rep", "start_frame", "end_frame", "events", "missing_events", "boundary_method" ], "properties": { "rep": { "type": "integer", "minimum": 1 }, "start_frame": { "type": "integer", "minimum": 0 }, "end_frame": { "type": "integer", "minimum": 0 }, "events": { "type": "object", "additionalProperties": false, "properties": { "stance_set": { "$ref": "#/$defs/event" }, "load_start": { "$ref": "#/$defs/event" }, "stride": { "$ref": "#/$defs/event" }, "foot_contact": { "$ref": "#/$defs/event" }, "foot_plant": { "$ref": "#/$defs/event" }, "swing_start": { "$ref": "#/$defs/event" }, "contact": { "$ref": "#/$defs/event" }, "finish": { "$ref": "#/$defs/event" } } }, "missing_events": { "type": "object", "additionalProperties": { "type": "string" } }, "boundary_method": { "enum": [ "caller_declared_single_swing", "caller_supplied", "automatic_2d_hand_motion_candidate" ] } } } } } }, "measurements": { "type": "object", "additionalProperties": false, "required": [ "schema_version", "discipline", "capture", "reps", "view", "fps" ], "properties": { "schema_version": { "const": "2.0" }, "discipline": { "const": "hitting" }, "level": { "enum": [ "hs_jv", "hs_varsity", "college" ] }, "view": { "enum": [ "face_on", "unknown" ] }, "fps": { "type": [ "number", "null" ], "exclusiveMinimum": 0 }, "capture": { "type": "object", "additionalProperties": false, "required": [ "ok", "reasons" ], "properties": { "ok": { "type": "boolean" }, "reasons": { "type": "array", "uniqueItems": true, "items": { "enum": [ "a_bit_blurry", "a_bit_dark", "low_fps", "low_pose_confidence", "multiple_people", "no_person", "partly_out_of_frame", "person_too_small", "player_switched", "pose_confidence_fair", "too_blurry", "too_dark", "very_low_fps", "view_uncertain", "wrong_view" ] } } }, "if": { "properties": { "ok": { "const": false } } }, "then": { "properties": { "reasons": { "minItems": 1 } } } }, "reps": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/measurement_rep" } } } }, "coach_payload": { "type": "object", "additionalProperties": false, "required": [ "schema_version", "discipline", "capture", "reps" ], "properties": { "schema_version": { "const": "2.0" }, "discipline": { "const": "hitting" }, "level": { "enum": [ "hs_jv", "hs_varsity", "college" ] }, "view": { "const": "face_on" }, "fps": { "type": "number", "exclusiveMinimum": 0 }, "capture": { "type": "object", "additionalProperties": false, "required": [ "ok", "reasons" ], "properties": { "ok": { "type": "boolean" }, "reasons": { "type": "array", "uniqueItems": true, "items": { "enum": [ "a_bit_blurry", "a_bit_dark", "low_fps", "low_pose_confidence", "multiple_people", "no_person", "partly_out_of_frame", "person_too_small", "player_switched", "pose_confidence_fair", "too_blurry", "too_dark", "very_low_fps", "view_uncertain", "wrong_view" ] } } }, "if": { "properties": { "ok": { "const": false } } }, "then": { "properties": { "reasons": { "minItems": 1 } } } }, "reps": { "type": "array", "maxItems": 100, "items": { "$ref": "#/$defs/measurement_rep" } } } }, "measurement_method": { "type": "object", "additionalProperties": false, "required": [ "version", "body_height_px", "body_height_method", "pitcher_direction", "processing", "validation" ], "properties": { "version": { "enum": [ "batting-2d-v1", "batting-2d-v2", "batting-2d-v3", "batting-2d-v4", "batting-2d-v5", "batting-2d-v6" ] }, "body_height_px": { "type": [ "number", "null" ], "exclusiveMinimum": 0 }, "body_height_method": { "type": "string" }, "pitcher_direction": { "enum": [ "image_left", "image_right", null ] }, "processing": { "type": "array", "items": { "type": "string" } }, "validation": { "const": "reference_validation_pending" }, "backend": { "enum": [ "2d", "rtmw3d", "sam3d" ] }, "quality_version": { "enum": [ "measurement-quality-v1", "measurement-quality-v2" ] } } }, "experimental_body3d": { "type": "object", "additionalProperties": false, "required": [ "backend", "status", "reason", "validation", "unit", "frame_of_reference", "axes", "frames", "requested_frames", "omitted_windows", "elapsed_s" ], "properties": { "backend": { "enum": [ "2d", "rtmw3d", "sam3d" ] }, "status": { "enum": [ "disabled", "unavailable", "ready", "partial" ] }, "reason": { "type": "string" }, "validation": { "const": "reference_validation_pending" }, "unit": { "const": "m" }, "frame_of_reference": { "const": "camera" }, "axes": { "const": "x right, y down, z away" }, "frames": { "type": "array", "items": { "type": "object", "required": [ "frame", "points", "projection", "scores" ], "additionalProperties": false, "properties": { "frame": { "type": "integer", "minimum": 0 }, "points": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": [ "number", "null" ] } } }, "projection": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": [ "number", "null" ] } } }, "scores": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1 } }, "relative_depth_m": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": [ "number", "null" ] } }, "camera_intrinsics": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": "array", "minItems": 3, "maxItems": 3, "items": { "type": [ "number", "null" ] } } }, "depth_peak_response": { "type": "array", "minItems": 17, "maxItems": 17, "items": { "type": [ "number", "null" ] } } } } }, "requested_frames": { "type": "array", "items": { "type": "integer", "minimum": 0 } }, "omitted_windows": { "type": "array", "items": { "type": "object" } }, "elapsed_s": { "type": "number", "minimum": 0 }, "model": { "type": "object" }, "geometry": { "type": "object" } } }, "measurement_diagnostics": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "rep", "metrics" ], "properties": { "rep": { "type": "integer", "minimum": 1 }, "metrics": { "type": "array", "minItems": 9, "maxItems": 9, "items": { "type": "object", "required": [ "key", "status", "method", "validation", "note" ], "properties": { "key": { "type": "string" }, "status": { "enum": [ "estimated", "withheld" ] }, "method": { "type": "string" }, "validation": { "const": "reference_validation_pending" }, "note": { "type": "string" } } } } } } } }, "$defs": { "point": { "type": [ "array", "null" ], "minItems": 2, "maxItems": 2, "items": { "type": "number" } }, "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, "event": { "type": "object", "additionalProperties": false, "required": [ "frame", "confidence", "estimated", "method", "note" ], "properties": { "frame": { "type": "integer", "minimum": 0 }, "t_s": { "type": "number" }, "confidence": { "type": "number", "minimum": 0, "maximum": 1 }, "estimated": { "const": true }, "method": { "type": "string" }, "note": { "type": "string" }, "evidence": { "type": "object" } } }, "metric": { "oneOf": [ { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "stride_pct_height" }, "value": { "type": [ "number", "null" ], "minimum": 10, "maximum": 120 }, "unit": { "const": "%" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "foot_plant_to_contact_ms" }, "value": { "type": [ "number", "null" ], "minimum": 30, "maximum": 800 }, "unit": { "const": "ms" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "com_drift_pct_height" }, "value": { "type": [ "number", "null" ], "minimum": -80, "maximum": 80 }, "unit": { "const": "%" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "load_tempo_s" }, "value": { "type": [ "number", "null" ], "minimum": 0.05, "maximum": 3 }, "unit": { "const": "s" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "load_launch_ratio" }, "value": { "type": [ "number", "null" ], "minimum": 0.1, "maximum": 20 }, "unit": { "const": "ratio" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "head_movement_pct_height" }, "value": { "type": [ "number", "null" ], "minimum": 0, "maximum": 40 }, "unit": { "const": "%" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "lead_knee_angle_contact_deg" }, "value": { "type": [ "number", "null" ], "minimum": 60, "maximum": 200 }, "unit": { "const": "deg" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "lateral_trunk_tilt_contact_deg" }, "value": { "type": [ "number", "null" ], "minimum": -90, "maximum": 90 }, "unit": { "const": "deg" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } }, { "type": "object", "additionalProperties": false, "required": [ "key", "value", "unit", "confidence", "note" ], "properties": { "key": { "const": "hip_shoulder_separation_foot_plant_deg" }, "value": { "type": [ "number", "null" ], "minimum": -90, "maximum": 90 }, "unit": { "const": "deg" }, "confidence": { "const": "est" }, "note": { "type": "string", "minLength": 1 } } } ] }, "measurement_rep": { "type": "object", "additionalProperties": false, "required": [ "rep", "events_ms", "metrics", "quality" ], "properties": { "rep": { "type": "integer", "minimum": 1 }, "events_ms": { "type": "object", "additionalProperties": false, "properties": { "stance_set": { "type": "number", "minimum": 0 }, "load_start": { "type": "number", "minimum": 0 }, "stride": { "type": "number", "minimum": 0 }, "foot_contact": { "type": "number", "minimum": 0 }, "foot_plant": { "type": "number", "minimum": 0 }, "swing_start": { "type": "number", "minimum": 0 }, "contact": { "type": "number", "minimum": 0 }, "finish": { "type": "number", "minimum": 0 } } }, "metrics": { "type": "array", "minItems": 9, "maxItems": 9, "items": { "$ref": "#/$defs/metric" } }, "quality": { "type": "object", "additionalProperties": false, "required": [ "pose_conf", "blur" ], "properties": { "pose_conf": { "type": "number", "minimum": 0, "maximum": 1 }, "blur": { "type": "number", "minimum": 0, "maximum": 1 } } } } } } }
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Baseball 2D GPU result",
"type": "object",
"required": [
"schema_version",
"status",
"pose_track",
"measurements",
"warnings",
"capabilities",
"validation",
"coach_payload",
"measurement_method"
],
"additionalProperties": false,
"properties": {
"schema_version": {
"const": "1.0"
},
"status": {
"const": "partial"
},
"validation": {
"const": "reference_validation_pending"
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"capabilities": {
"type": "object",
"required": [
"gpu_2d",
"body_3d",
"automatic_rep_splitting",
"automatic_events",
"swing_metrics",
"coaching",
"pitching",
"estimated_only"
],
"properties": {
"gpu_2d": {
"const": true
},
"body_3d": {
"type": "boolean"
},
"automatic_rep_splitting": {
"const": true
},
"automatic_events": {
"const": true
},
"swing_metrics": {
"const": true
},
"coaching": {
"const": false
},
"pitching": {
"const": false
},
"estimated_only": {
"const": true
}
},
"additionalProperties": false
},
"pose_track": {
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"discipline",
"view",
"video",
"model",
"keypoint_order",
"extra_keypoint_order",
"frames",
"reps"
],
"properties": {
"schema_version": {
"const": "1.0"
},
"discipline": {
"const": "hitting"
},
"view": {
"enum": [
"face_on",
"unknown"
]
},
"video": {