Commit Graph

35 Commits

Author SHA1 Message Date
Kevin
9f9f24aa05 Add RTSP prewarm keep-alive and track backend/.env for team defaults.
Background ffmpeg pull on all site cameras reduces cold-start latency on start_surgery; timing logs record connect and ready phases. Enable via RTSP_PREWARM_ENABLED in the committed env.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 13:16:42 +08:00
Kevin
ae6300b8b2 Add rotating file logs, access noise filters, and longer RTSP start timeout.
Persist app logs under logs/app with 7-day rotation, suppress routine health/pending access lines, raise default VIDEO_OPEN_TIMEOUT_SEC to 90s, and document consumable codes plus client timeout guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 13:11:51 +08:00
op
5fd0851a44 update cam id 2026-05-25 16:39:08 +08:00
op
caf62f232c Fix Docker uv sync flags by dropping UV_COMPILE_BYTECODE env.
uv treats a set UV_COMPILE_BYTECODE (even "0") as compile-bytecode, which conflicts with --no-compile on sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 12:06:42 +08:00
op
be24fd77f4 Fix RTSP segment ffmpeg args for bookworm and video-only MP4.
Parse OpenCV rtsp_transport options correctly, use -timeout instead of removed -stimeout, map only the first video stream with -an, tighten ready detection, and disable uv bytecode compile during Docker build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 12:05:28 +08:00
op
b8bf31c23c Improve demo client consumable UX and clarify live vs offline flows.
Separate mode-specific steps, show product code with name in chips, validate against mistaken video paths, and load label_id from labels.yaml via server.py.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 10:44:41 +08:00
Kevin
30e6acea70 Replace chain 1 with RTSP slice batch pipeline and add 24h segment TTL.
Route live recording through ffmpeg MP4 segments and the 5.15 batch subprocess, remove simulated RTSP chain 2, purge expired slices on startup and hourly, and expose TTL settings to the demo client.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 10:24:25 +08:00
Kevin
0917109d6a Align client surgery API with documented contract and support consumable codes.
Unify result 503 to RESULT_NOT_READY, restore resolve ASR failures as HTTP 422, accept label_id-only candidate_consumables, and document the changelog for integrators.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 09:36:09 +08:00
Kevin
aae0340a1b fix(docker): rewrite agentsmirror lock URLs and refresh numpy
uv.lock uses uv.agentsmirror.com paths that the old sed rules never matched,
which could install corrupted wheels from cache. Rewrite to Tsinghua mirrors,
force-refresh numpy/mediapipe, and verify numpy imports during the image build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 17:39:28 +08:00
Kevin
3de34fb79c fix(hls): forward MediaMTX LL-HLS session query in proxy
MediaMTX v1.18+ requires ?session= on sub-playlists; the API proxy was
dropping query params and causing 401 on video1_stream.m3u8 fetches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 17:35:25 +08:00
Kevin
e7510342ba fix 2026-05-22 17:18:40 +08:00
Kevin
c933815650 fix 2026-05-22 17:18:27 +08:00
Kevin
7e2426339e fix(docker): start mediamtx-hls without shell on scratch image.
Seed shared HLS config via alpine init container and pass explicit config path for ephemeral docker run.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 16:57:04 +08:00
Kevin
71eb88763d fix hls 2026-05-22 16:29:57 +08:00
Kevin
831000101e fix hls 2026-05-22 16:04:32 +08:00
Kevin
4736413f94 update demo client 2026-05-22 15:14:13 +08:00
Kevin
f28c0bd66d fix docker port 2026-05-22 15:11:22 +08:00
Kevin
e92dc1a6d9 Add HLS browser preview for live RTSP demo and real camera URLs.
MediaMTX pulls site-config RTSP into HLS with API proxying for hls.js on the demo client; simulated realtime keeps local file previews only. Also add optional JPEG frame capture and document Docker HLS host settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 14:44:28 +08:00
Kevin
d6f4590969 Clarify surgery result errors and expose offline batch timing.
Return specific codes when results are unavailable (not started vs in progress vs ended empty), block duplicate starts with SURGERY_ALREADY_RECORDING, and show text/video/total durations in the demo client.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 14:01:25 +08:00
Kevin
704a83607d Fix MediaPipe doctor recognition missing libGLESv2 in Docker.
Install Mesa/GLVND GLES/EGL runtime libraries and verify mediapipe import at image build time so headless doctor pose inference no longer fails on libGLESv2.so.2.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 11:57:52 +08:00
Kevin
78f96e24b1 Defer offline batch labeling until after inference results are ready.
Run visualization from pipeline/result paths without vis_pending copies, publish labeled MP4 for browser only after visualize_result_video completes, and purge batch cache after the background labeling task finishes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 11:19:12 +08:00
Kevin
580e3c0d3b remove dead code 2026-05-22 11:17:20 +08:00
Kevin
941c71e991 Improve speed 2026-05-22 11:15:22 +08:00
Kevin
87b6a7b804 various fix 2026-05-22 10:45:47 +08:00
Kevin
7600c5da2f fix docker 2026-05-22 10:25:34 +08:00
Kevin
2866fd3a1d update minio port 2026-05-22 10:03:10 +08:00
Kevin
62b14d7386 update minio port 2026-05-22 09:35:41 +08:00
Kevin
153c91f8ff 将 Demo 录制收敛为三条独立链路,并重做联调台 UI。
移除 demo_orch 统一编排,改为 recording_demo 与 live/simulated 服务;客户端拆分为静态资源,以模式卡片与 chip 耗材覆盖三链路联调,并同步测试与文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:50:23 +08:00
Kevin
09885b4184 实现 video batch 自动清理与按需标注视频,并补充子进程调用测试。
batch 完成后仅保留数据库文本结果,勾选时才生成临时标注视频(24h TTL);新增 FastAPI 到 reference bundle 与 algorithm_runner 的单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:30:48 +08:00
Kevin
e6434d0bb6 补提交 doctor_identity 所需的 MediaPipe 模型文件。
与权重一并纳入 git,便于 clone 后直接运行医生识别子进程。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:13:01 +08:00
Kevin
c5716cf0af 恢复 algorithm_subprocesses 权重文件的 git 追踪。
权重目录与 doctor_info.pth 纳入版本库;样本视频、Excel、构建缓存仍保持 ignore。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:12:00 +08:00
Kevin
70431ca3f9 重命名 refs 为 algorithm_subprocesses,并清理误提交的权重与缓存文件。
算法子进程目录仅保留源码与配置;权重、样本 I/O、构建产物通过 .gitignore 离线交付。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:10:08 +08:00
Kevin
1af442481e 重组为 backend/clients/docs 三层结构,并清理 git 污染。
将后端迁入 backend/,完善根目录 .gitignore,删除误提交的 .mypy_cache 缓存文件。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 16:02:25 +08:00
Kevin
6bc6801df9 统一 Docker Compose 部署,并将客户端拆分为独立子项目。
移除宿主机/conda 启动脚本与 dev 联调工具,后端仅通过 docker compose 部署并默认启用 GPU。模拟客户端与语音确认页迁入 clients/ 下自包含目录,切断对后端源码路径的依赖。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 15:56:53 +08:00
Kevin
c869fcc6b9 init 2026-05-21 15:48:03 +08:00