NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Adjust LPR packages for licensing (#20780)
Nicolas Mowenfc1cad28729c
diff --git a/docker/main/requirements-wheels.txt b/docker/main/requirements-wheels.txtindex 7c0dc18434..b28de5e6bb 100644--- a/docker/main/requirements-wheels.txt+++ b/docker/main/requirements-wheels.txt@@ -56,7 +56,7 @@ pywebpush == 2.0.*# alprpyclipper == 1.3.*shapely == 2.0.*-Levenshtein==0.26.*+rapidfuzz==3.12.*# HailoRT Wheelsappdirs==1.4.*argcomplete==2.0.*diff --git a/frigate/data_processing/common/license_plate/mixin.py b/frigate/data_processing/common/license_plate/mixin.pyindex 80a169c258..a2509d4fad 100644--- a/frigate/data_processing/common/license_plate/mixin.py+++ b/frigate/data_processing/common/license_plate/mixin.py@@ -14,8 +14,8 @@ from typing import Any, List, Optional, Tupleimport cv2import numpy as np-from Levenshtein import distance, jaro_winklerfrom pyclipper import ET_CLOSEDPOLYGON, JT_ROUND, PyclipperOffset+from rapidfuzz.distance import JaroWinkler, Levenshteinfrom shapely.geometry import Polygonfrom frigate.comms.event_metadata_updater import (@@ -1123,7 +1123,9 @@ class LicensePlateProcessingMixin:for i, plate in enumerate(plates):merged = Falsefor j, cluster in enumerate(clusters):- sims = [jaro_winkler(plate["plate"], v["plate"]) for v in cluster]+ sims = [+ JaroWinkler.similarity(plate["plate"], v["plate"]) for v in cluster+ ]if len(sims) > 0:avg_sim = sum(sims) / len(sims)if avg_sim >= self.cluster_threshold:@@ -1500,7 +1502,7 @@ class LicensePlateProcessingMixin:and current_time - data["last_seen"]<= self.config.cameras[camera].lpr.expire_time):- similarity = jaro_winkler(data["plate"], top_plate)+ similarity = JaroWinkler.similarity(data["plate"], top_plate)if similarity >= self.similarity_threshold:plate_id = existing_idlogger.debug(@@ -1580,7 +1582,8 @@ class LicensePlateProcessingMixin:for label, plates_list in self.lpr_config.known_plates.items()if any(re.match(f"^{plate}$", rep_plate)- or distance(plate, rep_plate) <= self.lpr_config.match_distance+ or Levenshtein.distance(plate, rep_plate)+ <= self.lpr_config.match_distancefor plate in plates_list)),