@@ -85,22 +85,19 @@ def _check_frigate(self):
8585 try :
8686 r = requests .get (f"{ url } /api/config" , timeout = 8 )
8787 if r .status_code != 200 :
88- log .error ("Frigate unter %s antwortet mit HTTP %s — ohne Snapshots kann "
89- "nicht erkannt werden" , url , r .status_code )
88+ log .error ("Frigate at %s replied HTTP %s — without snapshots nothing can be recognised" , url , r .status_code )
9089 return
9190 cams = list ((r .json ().get ("cameras" ) or {}).keys ())
92- log .info ("Frigate erreichbar (%s), Kameras : %s" , url , ", " .join (cams ) or "keine" )
91+ log .info ("Frigate reachable (%s), cameras : %s" , url , ", " .join (cams ) or "keine" )
9392 if self .cameras :
9493 unknown = self .cameras - set (cams )
9594 if unknown :
96- log .warning ("Konfigurierte Kamera(s) %s gibt es in Frigate nicht — "
97- "von diesen wird nie etwas verarbeitet" , ", " .join (sorted (unknown )))
95+ log .warning ("Configured camera(s) %s do not exist in Frigate — nothing from these will ever be processed" , ", " .join (sorted (unknown )))
9896 except (requests .RequestException , ValueError ) as e :
99- log .error ("Frigate unter %s nicht erreichbar: %s — Snapshots und damit die "
100- "Erkennung werden fehlschlagen" , url , e )
97+ log .error ("Frigate at %s unreachable: %s — snapshots, and therefore recognition, will fail" , url , e )
10198
10299 def _on_connect (self , client , userdata , flags , reason_code , properties ):
103- log .info ("MQTT verbunden (%s), abonniere %s/events" , reason_code , self .frigate_topic )
100+ log .info ("MQTT connected (%s), subscribing to %s/events" , reason_code , self .frigate_topic )
104101 client .subscribe (f"{ self .frigate_topic } /events" )
105102 client .publish (f"{ self .prefix } /status" , "online" , retain = True )
106103 self ._publish_discovery ()
@@ -140,7 +137,7 @@ def _on_message(self, client, userdata, msg):
140137 try :
141138 self .queue .put_nowait ({"eid" : eid })
142139 except queue .Full :
143- log .warning ("Queue voll, Event %s übersprungen " , eid )
140+ log .warning ("queue full, skipping event %s " , eid )
144141
145142 # ---------- Verarbeitung ----------
146143
@@ -150,7 +147,7 @@ def _worker(self):
150147 try :
151148 self ._process (item ["eid" ])
152149 except Exception :
153- log .exception ("Fehler bei Event %s" , item ["eid" ])
150+ log .exception ("error while handling event %s" , item ["eid" ])
154151
155152 def _process (self , eid : str ):
156153 st = self .events .get (eid )
@@ -159,7 +156,7 @@ def _process(self, eid: str):
159156 st ["attempts" ] += 1
160157 img = self .frigate .snapshot (eid , crop = True )
161158 if img is None :
162- log .info ("Event %s (%s): kein Snapshot von Frigate" , eid , st ["camera" ])
159+ log .info ("event %s (%s): no snapshot from Frigate" , eid , st ["camera" ])
163160 return
164161 found = self .engine .faces (img )
165162 face = FaceEngine .best_face (found , min_px = self .min_face_px )
@@ -172,11 +169,11 @@ def _process(self, eid: str):
172169 h , w = img .shape [:2 ]
173170 if found :
174171 big = max (int (f .bbox [2 ] - f .bbox [0 ]) for f in found )
175- log .info ("Event %s (%s): Versuch %d, groesstes Gesicht %dpx < min_face_px "
172+ log .info ("event %s (%s): attempt %d, largest face %dpx < min_face_px "
176173 "%d (Snapshot %dx%d)" , eid , st ["camera" ], st ["attempts" ], big ,
177174 self .min_face_px , w , h )
178175 else :
179- log .info ("Event %s (%s): Versuch %d, kein Gesicht im Snapshot %dx%d" ,
176+ log .info ("event %s (%s): attempt %d, no face detected in snapshot %dx%d" ,
180177 eid , st ["camera" ], st ["attempts" ], w , h )
181178 return
182179 emb = face .normed_embedding
@@ -192,11 +189,11 @@ def _process(self, eid: str):
192189 if self .ignore_learning and ig >= self .ignore_thr + 0.1 and ig - score >= 0.1 :
193190 iid = self .gallery .add_ignore_anchor (crop_face (img , face .bbox ), emb )
194191 if iid :
195- log .info ("Event %s: neuer Auto-Ignore-Anker %s (sim %.3f)" , eid , iid , ig )
196- log .info ("Event %s (%s): ignoriertes Gesicht (sim %.3f)" , eid , st ["camera" ], ig )
192+ log .info ("event %s: new auto ignore anchor %s (sim %.3f)" , eid , iid , ig )
193+ log .info ("event %s (%s): ignored face (sim %.3f)" , eid , st ["camera" ], ig )
197194 return
198195 crop = crop_face (img , face .bbox )
199- log .info ("Event %s (%s): Versuch %d, Match %s (%.3f)" , eid , st ["camera" ], st ["attempts" ], name , score )
196+ log .info ("event %s (%s): attempt %d, match %s (%.3f)" , eid , st ["camera" ], st ["attempts" ], name , score )
200197
201198 if slug and score >= self .match_thr :
202199 if score > st ["best_score" ]:
@@ -236,7 +233,7 @@ def _poller(self):
236233 continue
237234 batch = r .json ()
238235 except (requests .RequestException , ValueError ) as e :
239- log .debug ("Poll fehlgeschlagen : %s" , e )
236+ log .debug ("poll failed : %s" , e )
240237 continue
241238 since = time .time ()
242239 for ev in batch :
@@ -259,12 +256,12 @@ def _poller(self):
259256 "start_time" : ev .get ("start_time" ) or time .time (),
260257 "end_time" : ev .get ("end_time" ),
261258 }
262- log .info ("Poll: Ereignis %s (%s) nachgezogen — von MQTT nie gemeldet " ,
259+ log .info ("poll: picked up event %s (%s) — never announced over MQTT " ,
263260 eid , cam )
264261 try :
265262 self .queue .put_nowait ({"eid" : eid })
266263 except queue .Full :
267- log .warning ("Queue voll — Poll-Ereignis %s verworfen " , eid )
264+ log .warning ("queue full — dropped polled event %s " , eid )
268265
269266 def _finalizer (self ):
270267 """Beendete Events abschließen: Unknown ablegen, 'unbekannt' melden, aufräumen."""
@@ -297,7 +294,7 @@ def _finalizer(self):
297294 new_w = int (face .bbox [2 ] - face .bbox [0 ])
298295 if new_w > old_w :
299296 crop , emb , full = crop_face (img , face .bbox ), face .normed_embedding , img
300- log .info ("Event %s: hi-res Referenz aus Aufnahme (%dpx statt %dpx)" ,
297+ log .info ("event %s: sharper reference from the recording (%dpx instead of %dpx)" ,
301298 eid , new_w , old_w )
302299 uid = self .gallery .save_unknown (
303300 crop , emb ,
@@ -307,7 +304,7 @@ def _finalizer(self):
307304 full_bgr = full ,
308305 )
309306 self ._publish_recognition (eid , st , "unknown" , u ["guess_score" ])
310- log .info ("Event %s: unbekanntes Gesicht abgelegt (%s)" , eid , uid )
307+ log .info ("event %s: unknown face stored (%s)" , eid , uid )
311308 self .events .pop (eid , None )
312309
313310 # ---------- Publish ----------
@@ -351,8 +348,7 @@ def _frigate_cameras(self) -> set:
351348 if r .status_code == 200 :
352349 return set ((r .json ().get ("cameras" ) or {}).keys ())
353350 except (requests .RequestException , ValueError ) as e :
354- log .warning ("Kameraliste von Frigate nicht abrufbar (%s) — Sensoren entstehen "
355- "dann erst, sobald die erste Person erkannt wird" , e )
351+ log .warning ("could not fetch the camera list from Frigate (%s) — sensors will appear once the first person is seen" , e )
356352 return set ()
357353
358354 def _ensure_discovery (self , cam : str ):
@@ -377,8 +373,8 @@ def _publish_discovery(self, only: list | None = None):
377373 or set (self .cfg ["faceid" ].get ("discovery_cameras" ) or [])
378374 or self ._frigate_cameras ())
379375 self ._announced |= cams
380- log .info ("MQTT-Discovery: %d Sensor(en) angemeldet %s" , len (cams ),
381- "" if cams else " — Kameras unbekannt, folgen bei der ersten Erkennung " )
376+ log .info ("MQTT discovery: announced %d sensor(s) %s" , len (cams ),
377+ "" if cams else " — cameras unknown, they follow on first recognition " )
382378 device = {"identifiers" : [self .prefix ], "name" : self .prefix .replace ("-" , " " ).title () if self .prefix != "faceid" else "FaceID" ,
383379 "manufacturer" : "Eigenbau" , "model" : "InsightFace/ArcFace" }
384380 for cam in cams :
0 commit comments