版本变更V3.31添加识图功能
This commit is contained in:
@ -26,15 +26,26 @@ from app.extensions import db
|
||||
from app.utils.ai_vision import get_image_embedding, load_clip_model
|
||||
|
||||
# ============================================================================
|
||||
# 业务配置:表 → 图片字段 → 向量字段 映射
|
||||
# 业务配置:表 → 图片字段 → 向量字段 映射 (已全面修复)
|
||||
# ============================================================================
|
||||
TARGET_TABLES = [
|
||||
# 基础物料
|
||||
# 1. 基础物料
|
||||
{"table": "material_base", "img_col": "product_image", "vec_col": "img_embedding"},
|
||||
|
||||
# 采购入库
|
||||
# 2. 采购入库
|
||||
{"table": "stock_buy", "img_col": "arrival_photo", "vec_col": "arrival_image_embedding"},
|
||||
{"table": "stock_buy", "img_col": "qc_report", "vec_col": "qc_report_image_embedding"},
|
||||
{"table": "stock_buy", "img_col": "inspection_report", "vec_col": "qc_report_image_embedding"}, # 已修复: qc_report -> inspection_report
|
||||
|
||||
# 3. 半成品入库 (新增)
|
||||
{"table": "stock_semi", "img_col": "arrival_photo", "vec_col": "arrival_image_embedding"},
|
||||
{"table": "stock_semi", "img_col": "quality_report_link", "vec_col": "qc_report_image_embedding"},
|
||||
|
||||
# 4. 成品入库 (新增)
|
||||
{"table": "stock_product", "img_col": "product_photo", "vec_col": "arrival_image_embedding"},
|
||||
{"table": "stock_product", "img_col": "quality_report_link", "vec_col": "qc_report_image_embedding"}
|
||||
|
||||
# 注意:成品入库表还有一个 inspection_report_link,但由于数据库中成品表目前只加了两个向量字段,
|
||||
# 暂不将该字段加入遍历,以免覆盖 quality_report_link 的特征。
|
||||
]
|
||||
|
||||
# 物理图片根目录(相对于 app 目录的相对路径 ../uploads/)
|
||||
|
||||
Reference in New Issue
Block a user