Commit Graph

25 Commits

Author SHA1 Message Date
wsy182 6dee2a2ff3 feat(exercise): 优化死虫式训练姿态检测算法
- 调整视频处理频率从每帧处理改为每2帧处理
- 添加膝角趋势平滑算法减少单帧抖动误判
- 改进对角伸展检测逻辑支持准备位手臂上举
- 优化状态机确保严格回到准备姿态才计数
- 添加姿态丢失时的候选帧清理机制
- 更新音频文件生成路径至resources目录
- 改进macOS音频生成使用AIFF格式提高质量
- 添加详细的帧处理日志输出间隔配置
2026-06-10 22:57:35 +08:00
wsy182 ea0c007441 Clean up RepAnnouncer: remove TTS code, play pre-generated audio only
- RepAnnouncer now only plays audio files, no TTS generation
- Removed pyttsx3 dependency, rate/volume params from constructor
- Audio generation delegated to app/audio/generate.py (called at startup)
- Default audio dir changed to resources/audio/reps
- Added resources/ to .gitignore
2026-06-10 11:51:05 +08:00
wsy182 b45a8e2e85 Add audio generation config, refactor rep_announcer
- AudioConfig now includes rep_max_count and rep_audio_dir
- app/audio/generate.py uses config instead of hardcoded constants
- RepAnnouncer rewrote with pre-generated audio cache
- Supports Windows winsound, macOS afplay, Linux paplay/aplay
- Pin requirements back to mediapipe==0.10.21 with numpy<2
2026-06-10 11:42:40 +08:00
wsy182 1f6c3f3de8 refactor(vision): 优化姿态关键点检测器的初始化逻辑
- 移除未使用的 threading 和 time 模块导入
- 统一委托类型的使用,避免硬编码委托类型
- 简化 GPU 和 CPU 委托的创建流程
- 修复委托类型传递的一致性问题
2026-06-10 11:26:39 +08:00
wsy182 37b85cd683 chore(deps): 更新依赖包版本
- 将 numpy 版本从 >=1.26,<2 更新为 >=2.4.6
- 将 mediapipe 版本从 ==0.10.21 更新为 ==0.10.35
- 保持其他依赖包版本不变
- 确保依赖版本兼容性
2026-06-10 10:35:45 +08:00
wsy182 c3f93e4441 为所有函数和类添加中文注释文档字符串 2026-06-10 10:34:11 +08:00
wsy182 c612a7ad71 style(config): 移除配置文件中的多余注释和环境变量设置
- 移除了 config.yaml 中的注释行
- 移除了 app/core/logging.py 中多余的空格
- 移除了 app/main.py 中的环境变量设置代码
- 移除了 app/main.py 中未使用的导入语句
2026-06-10 10:29:36 +08:00
wsy182 e86c2301ec Remove env var overrides, config.yaml is single source of truth
- Stripped _ENV_MAP and _apply_env_overrides from configs/load.py
- Cleaned up unused imports in video_receiver.py
- Restored MediaPipe env suppressors in app/main.py
- Removed .env.example (replaced by config.yaml)
2026-06-10 10:26:48 +08:00
wsy182 ae52578ed7 Separate config models from loader
- configs/models.py: AppConfig and all section dataclasses
- configs/load.py: pure loading logic (yaml, env overrides)
- config = load_config() singleton for consumers
2026-06-10 10:24:45 +08:00
wsy182 f9384f7bc1 Parse config.yaml into typed AppConfig dataclass
- ServerConfig, VideoConfig, ModelConfig, DeadBugConfig,
  AudioConfig, LoggingConfig as nested dataclasses
- Consumers use config.server.host, config.model.resolved_path etc.
- env var overrides preserved via _apply_env_overrides()
2026-06-10 10:23:51 +08:00
wsy182 c8fd057129 Centralize configuration into config.yaml
- All settings moved to config.yaml
- configs/load.py reads from config.yaml with env var overrides
- Environment variables still work for backward compatibility
- Added pyyaml to requirements
2026-06-10 10:19:41 +08:00
wsy182 4485cbf702 Refactor into modular app structure
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
2026-06-10 10:14:43 +08:00
wsy182 8b878cb9e5 Optimize pose server processing 2026-06-09 23:07:48 +08:00
wsy182 a16b3e2d77 Pin mediapipe to 0.10.21 to remove clearcut telemetry 2026-06-02 09:53:31 +08:00
wsy182 a4b62d930b Switch to LIVE_STREAM mode for real-time async inference 2026-06-02 09:40:22 +08:00
wsy182 be4a691fb5 Disable MediaPipe Clearcut telemetry 2026-06-02 09:32:56 +08:00
wsy182 fde0e0383d Add dead bug pose detection 2026-06-02 00:59:41 +08:00
wsy182 feb456261c Delete posefit-andrid 2026-06-01 23:59:43 +08:00
wsy182 02d7c48557 服务端改用 aiortc 实现 WebRTC 视频流接收
- handle_client.py: 替换原始 JPEG WebSocket 为 aiortc RTCPeerConnection

- 实现 SDP offer/answer 协商和 ICE candidate 交换

- 通过 track.recv() 接收 RTP 视频帧并 cv2.imshow 显示

- 服务端口改为 8765 匹配 Android 端

- 新增 requirements.txt: aiortc, websockets, opencv-python 等

- .gitignore 添加 __pycache__
2026-06-01 23:51:30 +08:00
hjwang b48a521b63 删除 .gitmodules 2026-06-01 22:28:29 +08:00
wsy182 855ca7c938 添加posefit-andrid子模块 2026-06-01 21:34:07 +08:00
wsy182 debc511312 保存当前更改 2026-06-01 21:33:00 +08:00
wsy182 1cfc72956e chore: 移除 .idea/ 目录的 Git 追踪并更新 .gitignore 2026-06-01 19:10:26 +08:00
wsy182 51dcc83e92 chore(project): 添加 IDE 配置文件到忽略列表
- 添加 .idea 目录到 .gitignore 文件
- 保持虚拟环境目录忽略配置
2026-06-01 18:13:01 +08:00
wsy182 644486445f first commit 2026-06-01 18:10:42 +08:00