4485cbf702
Split monolithic files into focused modules: - app/core: settings, logging, lifecycle - app/signaling: websocket server, ICE parser, message models - app/webrtc: peer session, video receiver, frame source - app/vision: pose landmarker wrapper, model config, pose types - app/exercises/dead_bug: detector, metrics, rules, state machine, types - app/rendering: skeleton renderer, status overlay, window display - app/audio: rep announcer - app/diagnostics: perf timer, crash handler - configs: environment-based settings - tests: unit tests for rules, state machine, ICE parser - run.py: entry point
22 lines
389 B
Python
22 lines
389 B
Python
from __future__ import annotations
|
|
|
|
import cv2
|
|
|
|
WINDOW_NAME = "Android Camera (WebRTC)"
|
|
|
|
|
|
def show_frame(image, window_name: str = WINDOW_NAME) -> None:
|
|
cv2.imshow(window_name, image)
|
|
|
|
|
|
def wait_key(delay_ms: int = 1) -> int:
|
|
return cv2.waitKey(delay_ms) & 0xFF
|
|
|
|
|
|
def is_esc_pressed() -> bool:
|
|
return wait_key(1) == 27
|
|
|
|
|
|
def close_window() -> None:
|
|
cv2.destroyAllWindows()
|