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:
from apps.hrm.tasks import 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 = DeepFace.find(img_path=img_path, db_path=db_path)
df = dfs[0]

View File

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