feat(人物管理/红框标记): 关键帧人脸标记 + 人物命名重命名回溯 + 人物管理页改版
1. fam-edge 新增 frame_marker.py: Edge 端人脸检测画红框+统计人脸数(NAS ARM 太弱只存图零计算),orchestrator 分析后回传前标记,新增 /api/edge/mark_frames 批量补标端点 2. fam-core 新增 tools/backfill_mark_frames.py: 存量关键帧批量补红框(幂等+备份 frames_orig) 3. db_layer.name_member 增强: 支持自动注册新标签/重命名回溯(旧真名一并替换)/多人组合字符串 REPLACE 4. fam-ui 成员命名页改为人物管理页: 所有人物照片墙+命名重命名+统计去重 5. event_receiver/member_manager 配套适配
This commit is contained in:
@@ -7,6 +7,7 @@ API-Gateway - Flask 蓝图,接收任务
|
||||
3. analyze (旧拉取模式, 兼容保留)
|
||||
"""
|
||||
import os
|
||||
import base64
|
||||
import threading
|
||||
import requests
|
||||
from flask import Blueprint, request, jsonify
|
||||
@@ -440,6 +441,34 @@ def receive_push_task():
|
||||
_currently_processing = False
|
||||
|
||||
|
||||
@api_bp.route('/api/edge/mark_frames', methods=['POST'])
|
||||
def mark_frames():
|
||||
"""NAS 存量关键帧批量补红框(检测计算在 Edge,NAS 只存图)"""
|
||||
data = request.get_json(silent=True)
|
||||
if not data:
|
||||
return jsonify({"error": "Invalid JSON"}), 400
|
||||
images = data.get('images')
|
||||
if not isinstance(images, list) or not images or len(images) > 12:
|
||||
return jsonify({"error": "images 需要 1-12 项 [{key, data}]"}), 400
|
||||
|
||||
from ..frame_marker import mark_jpeg
|
||||
results = []
|
||||
for item in images:
|
||||
key = item.get('key', '')
|
||||
b64 = item.get('data', '')
|
||||
try:
|
||||
marked, faces = mark_jpeg(base64.b64decode(b64))
|
||||
results.append({
|
||||
"key": key,
|
||||
"data": base64.b64encode(marked).decode('ascii'),
|
||||
"faces": faces
|
||||
})
|
||||
except Exception as e:
|
||||
logger.warning(f"补标失败 {key}: {e}")
|
||||
results.append({"key": key, "data": None, "faces": 0, "error": str(e)})
|
||||
return jsonify({"results": results}), 200
|
||||
|
||||
|
||||
@api_bp.route('/health', methods=['GET'])
|
||||
def health():
|
||||
"""健康检查"""
|
||||
|
||||
Reference in New Issue
Block a user