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:
@@ -2,10 +2,12 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from pathlib import Path
|
||||
from typing import Dict, Set
|
||||
from typing import Dict, List, Set, Tuple
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from app.compat import to_thread
|
||||
|
||||
from app.db import (
|
||||
add_watch_processed,
|
||||
health_snapshot_deliverable,
|
||||
@@ -28,7 +30,7 @@ def _state_path(settings: Settings) -> Path:
|
||||
return settings.action_watch_dir / ".fishaction_watch_processed.json"
|
||||
|
||||
|
||||
def iter_mp4(watch_dir: Path, recursive: bool) -> list[Path]:
|
||||
def iter_mp4(watch_dir: Path, recursive: bool) -> List[Path]:
|
||||
if recursive:
|
||||
return sorted(
|
||||
p
|
||||
@@ -56,7 +58,7 @@ async def _run_inference_and_state(
|
||||
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, settings
|
||||
)
|
||||
|
||||
@@ -98,7 +100,7 @@ async def _run_inference_and_state(
|
||||
async def watch_tick(
|
||||
settings: Settings,
|
||||
processed: Set[str],
|
||||
stability: Dict[str, tuple[int, int]],
|
||||
stability: Dict[str, Tuple[int, int]],
|
||||
state_file: Path,
|
||||
) -> bool:
|
||||
"""处理一轮目录扫描;若处理了至少一个文件返回 True。"""
|
||||
@@ -149,7 +151,7 @@ async def run_action_watch_loop(settings: Settings) -> None:
|
||||
if settings.action_watch_use_state_file
|
||||
else set()
|
||||
)
|
||||
stability: Dict[str, tuple[int, int]] = {}
|
||||
stability = {} # type: Dict[str, Tuple[int, int]]
|
||||
|
||||
logger.info(
|
||||
"[action-watch] watching {} (poll={}s, stable_polls={}, state={} {})",
|
||||
|
||||
Reference in New Issue
Block a user