From d6a5befca493e6b7da598f4af9153c58f34f6532 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Fri, 19 May 2023 09:43:22 -0600 Subject: [PATCH] Fix breakages by manual_event_api branch --- frigate/http.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/frigate/http.py b/frigate/http.py index 3ad8fb7af..a57d6e580 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -198,7 +198,7 @@ def send_to_plus(id): return make_response(jsonify({"success": False, "message": message}), 404) # events from before the conversion to relative dimensions cant include annotations - if any(d > 1 for d in event.box): + if any(d > 1 for d in event.data["box"]): include_annotation = None if event.end_time is None: @@ -313,11 +313,15 @@ def false_positive(id): # need to refetch the event now that it has a plus_id event = Event.get(Event.id == id) - region = event.region - box = event.box + region = event.data["region"] + box = event.data["box"] # provide top score if score is unavailable - score = event.top_score if event.score is None else event.score + score = ( + (event.data["top_score"] if event.data["top_score"] else event.top_score) + if event.data["score"] is None + else event.data["score"] + ) try: current_app.plus_api.add_false_positive( @@ -758,6 +762,7 @@ def events(): Event.top_score, Event.false_positive, Event.box, + Event.data, ] if camera != "all": @@ -916,6 +921,11 @@ def config(): config["plus"] = {"enabled": current_app.plus_api.is_active()} + for detector, detector_config in config["detectors"].items(): + detector_config["model"][ + "labelmap" + ] = current_app.frigate_config.model.merged_labelmap + return jsonify(config)