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