From 67eee02bdc0712d44239d4c08575e60cdba52b91 Mon Sep 17 00:00:00 2001 From: Antoine Gaudron-desjardins <antoine.gaudrondesjardins@student-cs.fr> Date: Thu, 21 Jul 2022 19:44:31 +0200 Subject: [PATCH] lint --- backend/video_capture.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/video_capture.py b/backend/video_capture.py index 234575f..8a9e787 100644 --- a/backend/video_capture.py +++ b/backend/video_capture.py @@ -18,6 +18,7 @@ host = os.getenv('MODEL_HOST') port = os.getenv('MODEL_PORT') model = os.getenv('MODEL_NAME') + def make_prediction(instances): url = f"http://{host}:{port}/v1/models/{model}:predict" data = json.dumps({"signature_name": "serving_default", "instances": instances.tolist()}) @@ -25,10 +26,11 @@ def make_prediction(instances): json_response = requests.post(url, data=data, headers=headers) try: predictions = json.loads(json_response.text)['predictions'] - except: + except BaseException: print("prediction failed") return predictions + async def handle_cameras(): db = SessionLocal() -- GitLab