feat: 配置写死与 baked 模块,Alembic 建表,百度仅 BAIDU_*

- 新增 app/baked/algorithm|pipeline,非部署参数不再走 env;Settings 保留 DB/HTTP/RTSP/海康/百度/MinIO/Demo
- 移除 init_db_schema 与 reload 配置;main 仅 check_database;start*.sh 在 uvicorn 前执行 alembic upgrade head
- 依赖 psycopg[binary] 供 Alembic 同步 URL;alembic/env 注释与预发清单更新
- 撕段门控消费管线、各视频/语音/归档调用改为 baked
- 百度环境变量仅 BAIDU_APP_ID、BAIDU_API_KEY、BAIDU_SECRET_KEY 与 BAIDU_* 超时/ASR;人脸脚本与 baidu_speech 文案同步
- 全量单测与 .env.example 更新;.gitignore 忽略 refs/(本地权重/视频不入库)

Made-with: Cursor
This commit is contained in:
Kevin
2026-04-24 15:33:22 +08:00
parent b651364877
commit 8a4bad99d3
47 changed files with 1333 additions and 648 deletions

View File

@@ -10,7 +10,7 @@ from __future__ import annotations
import time
from dataclasses import dataclass
from app.config import Settings
from app.baked import algorithm as ba
from app.services.consumable_vision_algorithm import (
ClsTop3,
PredictionResult,
@@ -40,8 +40,8 @@ class WindowInferenceAggregator:
便于与原逻辑保持一致;调用方在持有 ``state.lock`` 时调用下面的方法。
"""
def __init__(self, *, settings: Settings) -> None:
self._s = settings
def __init__(self) -> None:
pass
def ingest_snapshot_and_collect_ready(
self,
@@ -57,7 +57,7 @@ class WindowInferenceAggregator:
"""
_ = surgery_id
_ = camera_id
wsec = self._s.consumable_vision_window_sec
wsec = ba.CONSUMABLE_VISION_WINDOW_SEC
ready: list[WindowInferenceReady] = []
cis = state.camera_infer.setdefault(camera_id, CameraStreamInferState())
if cis.stream_t0 is None: