mirror of
https://github.com/serengil/deepface.git
synced 2025-06-05 19:15:23 +00:00
show more details in case of exception while api calls
This commit is contained in:
parent
a909d9c81a
commit
09fdf25bb8
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user