diff --git a/access_control_python_server/app.py b/access_control_python_server/app.py index f81a61e..3cb77de 100644 --- a/access_control_python_server/app.py +++ b/access_control_python_server/app.py @@ -19,8 +19,11 @@ def process_image(): request_data = json.loads(request.data.decode("utf-8")) img_nparr = np.frombuffer(base64.b64decode(request_data['image']), np.uint8) img = cv2.imdecode(img_nparr,cv2.IMREAD_COLOR) - racist_detector = DeepFace.analyze(img) - return racist_detector + try: + racist_detector = DeepFace.analyze(img) + return racist_detector + except: + return [] if __name__ == '__main__':