cli to control zed camera start and stop. 2. measure now use every svo2 file for 1 fish, give intermideate result and final result with confidecne level(*).
This commit is contained in:
@@ -5,6 +5,7 @@ from pathlib import Path
|
||||
|
||||
from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Request, Response
|
||||
|
||||
from app.compat import to_thread
|
||||
from app.db import (
|
||||
health_snapshot_deliverable,
|
||||
measure_snapshot_deliverable,
|
||||
@@ -30,9 +31,12 @@ async def _measure_job_serial(svo_path: Path, settings: Settings) -> None:
|
||||
async with app_state.measure_lock:
|
||||
app_state.measure_status = "running"
|
||||
try:
|
||||
snap = await asyncio.to_thread(
|
||||
measure_svc.run_full_measure, svo_path, settings
|
||||
)
|
||||
|
||||
def _run():
|
||||
with app_state.measure_thread_lock:
|
||||
return measure_svc.run_full_measure(svo_path, settings)
|
||||
|
||||
snap = await to_thread(_run)
|
||||
if measure_snapshot_deliverable(snap):
|
||||
save_measure_snapshot(
|
||||
settings, snap, source_path=str(svo_path.resolve())
|
||||
@@ -47,7 +51,7 @@ async def _action_job_serial(mp4_path: Path, settings: Settings) -> None:
|
||||
app_state.action_status = "running"
|
||||
try:
|
||||
# 返回 (第一个快照, 所有切片快照列表)
|
||||
first_snap, all_snaps = await asyncio.to_thread(
|
||||
first_snap, all_snaps = await to_thread(
|
||||
action_svc.run_full_action, mp4_path, settings
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user