mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +03:00
Send and save score for external events
This commit is contained in:
parent
c6d0e93157
commit
fbbd55149a
@ -233,7 +233,7 @@ class AudioEventMaintainer(threading.Thread):
|
||||
|
||||
resp = requests.post(
|
||||
f"{FRIGATE_LOCALHOST}/api/events/{self.config.name}/{label}/create",
|
||||
json={"duration": None, "source_type": "audio"},
|
||||
json={"duration": None, "score": score, "source_type": "audio"},
|
||||
)
|
||||
|
||||
if resp.status_code == 200:
|
||||
|
||||
@ -31,6 +31,7 @@ class ExternalEventProcessor:
|
||||
label: str,
|
||||
source_type: str,
|
||||
sub_label: Optional[str],
|
||||
score: int,
|
||||
duration: Optional[int],
|
||||
include_recording: bool,
|
||||
draw: dict[str, any],
|
||||
@ -56,6 +57,7 @@ class ExternalEventProcessor:
|
||||
"id": event_id,
|
||||
"label": label,
|
||||
"sub_label": sub_label,
|
||||
"score": score,
|
||||
"camera": camera,
|
||||
"start_time": now - camera_config.record.events.pre_capture,
|
||||
"end_time": now
|
||||
|
||||
@ -230,7 +230,11 @@ class EventProcessor(threading.Thread):
|
||||
Event.has_clip: event_data["has_clip"],
|
||||
Event.has_snapshot: event_data["has_snapshot"],
|
||||
Event.zones: [],
|
||||
Event.data: {"type": event_data["type"]},
|
||||
Event.data: {
|
||||
"type": event_data["type"],
|
||||
"score": event_data["score"],
|
||||
"top_score": event_data["score"],
|
||||
},
|
||||
}
|
||||
Event.insert(event).execute()
|
||||
elif event_type == "end":
|
||||
|
||||
@ -899,6 +899,7 @@ def create_event(camera_name, label):
|
||||
label,
|
||||
json.get("source_type", "api"),
|
||||
json.get("sub_label", None),
|
||||
json.get("score", 0),
|
||||
json.get("duration", 30),
|
||||
json.get("include_recording", True),
|
||||
json.get("draw", {}),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user