From f47aa85b0d3793326dd27a98b8c4422b002bfd52 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Mon, 10 Jul 2023 18:45:31 -0600 Subject: [PATCH] Throw error when score is outside expected bounds --- frigate/http.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frigate/http.py b/frigate/http.py index 861a388ea..50c7aba1c 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -386,6 +386,18 @@ def set_sub_label(id): 400, ) + if new_score > 1.0 or new_score < 0: + return make_response( + jsonify( + { + "success": False, + "message": new_score + + " does not fit within the expected bounds 0 < score < 1.0", + } + ), + 400, + ) + if not event.end_time: tracked_obj: TrackedObject = ( current_app.detected_frames_processor.camera_states[