diff --git a/Dockerfile b/Dockerfile index 53f9b8c..d85d5bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,8 @@ COPY ./README.md /app/ # if you plan to use a GPU, you should install the 'tensorflow-gpu' package # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org tensorflow-gpu +# if you plan to use face anti-spoofing, then activate this line +# RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org torch==2.1.2 # ----------------------------------- # install deepface from pypi release (might be out-of-date) # RUN pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org deepface diff --git a/deepface/api/src/modules/core/service.py b/deepface/api/src/modules/core/service.py index ec3b6b1..4188229 100644 --- a/deepface/api/src/modules/core/service.py +++ b/deepface/api/src/modules/core/service.py @@ -1,3 +1,7 @@ +# built-in dependencies +import traceback + +# project dependencies from deepface import DeepFace # pylint: disable=broad-except @@ -24,7 +28,8 @@ def represent( result["results"] = embedding_objs return result except Exception as err: - return {"error": f"Exception while representing: {str(err)}"}, 400 + tb_str = traceback.format_exc() + return {"error": f"Exception while representing: {str(err)} - {tb_str}"}, 400 def verify( @@ -50,7 +55,8 @@ def verify( ) return obj except Exception as err: - return {"error": f"Exception while verifying: {str(err)}"}, 400 + tb_str = traceback.format_exc() + return {"error": f"Exception while verifying: {str(err)} - {tb_str}"}, 400 def analyze( @@ -75,4 +81,5 @@ def analyze( result["results"] = demographies return result except Exception as err: - return {"error": f"Exception while analyzing: {str(err)}"}, 400 + tb_str = traceback.format_exc() + return {"error": f"Exception while analyzing: {str(err)} - {tb_str}"}, 400