fix: face_find bug
This commit is contained in:
parent
1416b83b4e
commit
c8a0bd06af
|
@ -410,13 +410,13 @@ class HrmService:
|
||||||
img_path = settings.BASE_DIR +'/temp/face_' + img_name +'.jpg'
|
img_path = settings.BASE_DIR +'/temp/face_' + img_name +'.jpg'
|
||||||
with open(img_path, 'wb') as f:
|
with open(img_path, 'wb') as f:
|
||||||
f.write(base64_data)
|
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)
|
face_df = cache.get('global_face_df', None)
|
||||||
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()
|
||||||
# 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]
|
||||||
if not df.empty:
|
if not df.empty:
|
||||||
matched = df.iloc[0].identity
|
matched = df.iloc[0].identity
|
||||||
|
|
Loading…
Reference in New Issue