Commit Graph

12 Commits

Author SHA1 Message Date
9b4b69a65c chore: 清理git追踪的缓存和日志文件
将 __pycache__、logs、.claude 加入 .gitignore 并从索引移除

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 09:56:33 +08:00
fa0304aa47 feat: 重构数据库schema分离空间与业务配置 - 新增algorithm_registry和roi_algo_bind表 - roi_configs简化为纯空间配置 - 新增AlgorithmInfo/ROIAlgoBind数据模型 2026-02-03 14:26:52 +08:00
c17f983ab3 perf: batch=1 优化减少延迟
- settings: batch_size=41
- tensorrt_engine: BATCH_SIZE=41
- preprocessor: 移除 padding 逻辑,直接 batch=1
- 预处理延迟从 17ms  5ms
2026-02-02 15:25:13 +08:00
3dd4e56f99 fix: YOLO TensorRT 输出解析修复
- TensorRT 输出 shape: (1, 84, 4725)  (84, 4725)
- 正确解析 YOLO 输出格式: boxes[0:4], obj_conf[4], cls_scores[5:]
- 移除错误的 detection 遍历逻辑
- 工业级向量化操作代替 Python 循环
2026-02-02 15:02:58 +08:00
745cadc8e7 feat: TensorRT 固定 batch=4 重构
- tensorrt_engine.py 工业级 Buffer Pool
- preprocessor.py 添加 pad_to_batch4()
- postprocessor.py 支持批量输出
- settings.py 固定 batch_size=4
2026-02-02 14:49:47 +08:00
0a1d61c1e2 fix: 修复 TensorRT bindings 问题
- tensorrt_engine.py 添加 pycuda 支持
- CUDA 上下文和流管理
- _is_in_working_hours 支持字符串格式
2026-02-02 14:00:21 +08:00
f90ff60f6c feat: 添加离岗时长记录
- alert_records 添加 duration_minutes 字段
- AlgorithmManager 输出 duration_minutes
- AlertRecord 添加 duration_minutes 字段
2026-01-30 17:26:12 +08:00
4632ae74f3 fix: 修复运行错误
- algorithms.py 添加 threading/redis/logger 导入
- ResultReporter 添加 report_heartbeat() 和 close() 方法
2026-01-30 15:15:09 +08:00
101b26fc95 feat: 实现配置热更新机制
数据库扩展:
- roi_configs 新增算法参数字段(working_hours, confirm_on_duty_sec等)
- 新增 config_update_log 表记录配置变更日志

Redis缓存:
- ROI/摄像头配置缓存到 Redis(TTL 1小时)
- sync_all_to_redis() 批量同步配置
- notify_config_change() 发布配置变更通知

热更新:
- AlgorithmManager 订阅 Redis config_update 频道
- load_from_redis() 从 Redis 加载算法参数
- reload_algorithm() 热更新单个算法
- reload_all_algorithms() 重新加载所有算法

配置模型:
- ROIInfo 添加算法参数字段
2026-01-30 13:51:58 +08:00
816a67f33e feat: SQLite 添加设备配置表
- 新增 camera_configs 表(摄像头配置,永不删除)
- 新增 roi_configs 表(ROI配置,永不删除)
- 添加配置表的增删改查方法
- 只清理 alert_records 表(7天过期)
2026-01-30 11:42:12 +08:00
ccb021677c feat: 重构存储策略为 SQLite
- 新增 config/database.py: SQLite 数据库管理器
  - WAL 模式提升写入性能
  - 异步批量写入队列
  - 滚动清理机制(保留7天)

- 新增 core/storage_manager.py: 图片存储管理
  - 异步保存抓拍图片
  - 本地缓存断网容灾
  - 按日期分目录存储

- 更新 config/settings.py: 添加 SQLite 配置
  - SQLiteConfig 数据类
  - 环境变量支持

- 更新 core/result_reporter.py: 适配新存储
  - 使用 SQLite 替代 MySQL
  - AlertInfo 数据类重构
  - 断网自动缓存到本地
2026-01-30 11:34:51 +08:00
b0ddb6ee1a feat(project): move edge_inference_service contents to root and update paths
- Moved all project files and directories (config, core, models, etc.) from
  edge_inference_service/ to the repository root ai_edge/
- Updated model path in config/settings.py to reflect new structure
- Revised usage paths in __init__.py documentation
2026-01-29 18:43:19 +08:00