fix: hrm face_data 字段

This commit is contained in:
caoqianming 2023-09-11 17:41:30 +08:00
parent 8fd85bed02
commit 6c10cb647f
2 changed files with 2 additions and 2 deletions

View File

@ -415,6 +415,7 @@ class HrmService:
if face_df is None: if face_df is None:
from apps.hrm.tasks import update_global_face_pd from apps.hrm.tasks import update_global_face_pd
face_df = update_global_face_pd() face_df = update_global_face_pd()
face_df = cache.get('global_face_df')
dfs = face_find(img_path=img_path, global_df=face_df) dfs = face_find(img_path=img_path, global_df=face_df)
# dfs = DeepFace.find(img_path=img_path, db_path=db_path) # dfs = DeepFace.find(img_path=img_path, db_path=db_path)
df = dfs[0] df = dfs[0]

View File

@ -133,4 +133,3 @@ def update_global_face_pd():
user__is_active=True).values_list('id', 'face_data') user__is_active=True).values_list('id', 'face_data')
face_df = pd.DataFrame(list(facedata), columns=["identity", "VGG-Face_representation"]) face_df = pd.DataFrame(list(facedata), columns=["identity", "VGG-Face_representation"])
cache.set('global_face_df', face_df, timeout=None) cache.set('global_face_df', face_df, timeout=None)
return face_df