fix: face_find bug

This commit is contained in:
caoqianming 2023-09-11 17:24:38 +08:00
parent 1416b83b4e
commit c8a0bd06af
1 changed files with 3 additions and 3 deletions

View File

@ -410,13 +410,13 @@ class HrmService:
img_path = settings.BASE_DIR +'/temp/face_' + img_name +'.jpg'
with open(img_path, 'wb') as f:
f.write(base64_data)
db_path = os.path.join(settings.BASE_DIR, 'media/face')
# db_path = os.path.join(settings.BASE_DIR, 'media/face')
face_df = cache.get('global_face_df', None)
if face_df is None:
from apps.hrm.tasks import update_global_face_pd
face_df = update_global_face_pd()
# dfs = face_find(img_path=img_path, global_df=face_df)
dfs = DeepFace.find(img_path=img_path, db_path=db_path)
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]
if not df.empty:
matched = df.iloc[0].identity