mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +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
|
# 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
|
# 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)
|
# 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
|
# 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
|
from deepface import DeepFace
|
||||||
|
|
||||||
# pylint: disable=broad-except
|
# pylint: disable=broad-except
|
||||||
@ -24,7 +28,8 @@ def represent(
|
|||||||
result["results"] = embedding_objs
|
result["results"] = embedding_objs
|
||||||
return result
|
return result
|
||||||
except Exception as err:
|
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(
|
def verify(
|
||||||
@ -50,7 +55,8 @@ def verify(
|
|||||||
)
|
)
|
||||||
return obj
|
return obj
|
||||||
except Exception as err:
|
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(
|
def analyze(
|
||||||
@ -75,4 +81,5 @@ def analyze(
|
|||||||
result["results"] = demographies
|
result["results"] = demographies
|
||||||
return result
|
return result
|
||||||
except Exception as err:
|
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