diff --git a/apps/hrm/serializers.py b/apps/hrm/serializers.py index 5e6f95ef..d24f6673 100755 --- a/apps/hrm/serializers.py +++ b/apps/hrm/serializers.py @@ -73,7 +73,7 @@ class EmployeeCreateUpdateSerializer(CustomModelSerializer): if old_photo != instance.photo: # 如果照片有变动,需要更新人脸库 face_data, msg = HrmService.get_facedata_from_img(settings.BASE_DIR + instance.photo) if face_data: - instance.facenet512_data = face_data + instance.facenet_data = face_data instance.save() else: raise ParseError(msg) diff --git a/apps/hrm/tasks.py b/apps/hrm/tasks.py index ffefbf72..1682bb9a 100755 --- a/apps/hrm/tasks.py +++ b/apps/hrm/tasks.py @@ -118,7 +118,7 @@ def delete_face_pkl(epId): photo_path = settings.BASE_DIR + ep.photo face_path = os.path.join(settings.FACE_PATH, f'{epId}.jpg') shutil.copy(photo_path, face_path) - file_path = os.path.join(settings.BASE_DIR, 'media/face/representations_facenet512.pkl') + file_path = os.path.join(settings.BASE_DIR, 'media/face/representations_vgg_face.pkl') if os.path.exists(file_path): try: os.remove(file_path)