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
33 lines
2.5 KiB
Python
33 lines
2.5 KiB
Python
from __future__ import annotations
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
# ── Server ──────────────────────────────────────────────────────────────────
|
|
WS_HOST = os.getenv("POSEFIT_WS_HOST", "0.0.0.0")
|
|
WS_PORT = int(os.getenv("POSEFIT_WS_PORT", "8765"))
|
|
WS_MAX_SIZE = int(os.getenv("POSEFIT_WS_MAX_SIZE", str(10 * 1024 * 1024)))
|
|
|
|
# ── Video processing ────────────────────────────────────────────────────────
|
|
PROCESS_EVERY_N_FRAMES = max(1, int(os.getenv("POSEFIT_PROCESS_EVERY_N_FRAMES", "1")))
|
|
|
|
# ── Model ───────────────────────────────────────────────────────────────────
|
|
MODEL_DIR: Path = Path(__file__).resolve().parent.parent / "pose_models"
|
|
MODEL_PATH = os.getenv("POSEFIT_MODEL_PATH", str(MODEL_DIR / "pose_landmarker_full.task"))
|
|
PREFER_GPU = os.getenv("POSEFIT_PREFER_GPU", "1") not in ("0", "false", "False")
|
|
|
|
# ── Dead bug exercise ───────────────────────────────────────────────────────
|
|
VISIBILITY_THRESHOLD = float(os.getenv("POSEFIT_VISIBILITY_THRESHOLD", "0.45"))
|
|
EXTENSION_CONFIRM_FRAMES = int(os.getenv("POSEFIT_EXTENSION_CONFIRM_FRAMES", "4"))
|
|
RESET_CONFIRM_FRAMES = int(os.getenv("POSEFIT_RESET_CONFIRM_FRAMES", "3"))
|
|
|
|
# ── Audio ───────────────────────────────────────────────────────────────────
|
|
REP_ANNOUNCER_ENABLED = os.getenv("POSEFIT_REP_ANNOUNCER_ENABLED", "1") not in ("0", "false", "False")
|
|
REP_ANNOUNCER_RATE = int(os.getenv("POSEFIT_REP_ANNOUNCER_RATE", "185"))
|
|
REP_ANNOUNCER_VOLUME = float(os.getenv("POSEFIT_REP_ANNOUNCER_VOLUME", "1.0"))
|
|
|
|
# ── Logging ─────────────────────────────────────────────────────────────────
|
|
LOG_DIR: Path = Path(__file__).resolve().parent.parent / "logs"
|
|
LOG_ROTATION = os.getenv("POSEFIT_LOG_ROTATION", "20 MB")
|
|
LOG_RETENTION = os.getenv("POSEFIT_LOG_RETENTION", "14 days")
|