feat: consumption log top1 + elapsed since recording; RTSP play once

- Add top1_name/top1_conf to TSV and show top1–3 in pending markdown
- Add 相对开录 column and pass since_recording_start from surgery start
- Track surgery_started_wall and format_elapsed_mmss_since in session registry
- Remove ffmpeg stream_loop from synthetic/demo fake RTSP (play once)
- Fix fake_rtsp_from_file poll loop indentation; update README
- Extend consumption TSV tests; add face test PNGs under tests/faces

Made-with: Cursor
This commit is contained in:
Kevin
2026-04-27 09:22:46 +08:00
parent 8a6bfe9100
commit e4c6127619
13 changed files with 130 additions and 40 deletions

View File

@@ -30,6 +30,7 @@ from app.services.video.session_registry import (
RunningSurgery,
SurgerySessionRegistry,
SurgerySessionState,
format_elapsed_mmss_since,
)
from app.services.tear_gated_segment_consumption.product_map import (
load_tear_segment_name_to_id,
@@ -166,6 +167,7 @@ class CameraSessionManager:
state = SurgerySessionState(
candidate_consumables=list(resolved),
name_to_code=name_to_code,
surgery_started_wall=time.time(),
)
stop_event = asyncio.Event()
readies = [asyncio.Event() for _ in camera_ids]
@@ -447,9 +449,13 @@ class CameraSessionManager:
if bp.VIDEO_LOG_INFERENCE_RESULTS:
logger.info(
"Vision result surgery={} camera={} top1={}({:.3f}) top2={}({:.3f}) top3={}({:.3f})",
"Vision result surgery={} camera={} 相对开录={} top1={}({:.3f}) top2={}({:.3f}) top3={}({:.3f})",
surgery_id,
camera_id,
format_elapsed_mmss_since(
state.surgery_started_wall,
at_epoch=time.time(),
),
snap.t1_name,
snap.t1_conf,
snap.t2_name,