From 6c10cb647f7eb26738aa3a997ec9710a0c3ad184 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 11 Sep 2023 17:41:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20hrm=20face=5Fdata=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/hrm/services.py | 1 + apps/hrm/tasks.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 433b2d30..a361b792 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -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] diff --git a/apps/hrm/tasks.py b/apps/hrm/tasks.py index 1682bb9a..9db26380 100755 --- a/apps/hrm/tasks.py +++ b/apps/hrm/tasks.py @@ -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 \ No newline at end of file + cache.set('global_face_df', face_df, timeout=None) \ No newline at end of file