mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-04 13:47:37 +02:00
Fixes (#18935)
* Sort names alphabetically in face library dropdown * fix potential divide by zero in misconfigured speed zones
This commit is contained in:
parent
6563f78ab0
commit
9ffa7f140c
@ -59,6 +59,11 @@ def create_ground_plane(zone_points, distances):
|
|||||||
:param y: Y-coordinate in the image
|
:param y: Y-coordinate in the image
|
||||||
:return: Real-world distance per pixel at the given (x, y) coordinate
|
:return: Real-world distance per pixel at the given (x, y) coordinate
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Return 0 if divide by zero would occur
|
||||||
|
if (B[0] - A[0]) == 0 or (D[1] - A[1]) == 0:
|
||||||
|
return 0
|
||||||
|
|
||||||
# Normalize x and y within the zone
|
# Normalize x and y within the zone
|
||||||
x_norm = (x - A[0]) / (B[0] - A[0])
|
x_norm = (x - A[0]) / (B[0] - A[0])
|
||||||
y_norm = (y - A[1]) / (D[1] - A[1])
|
y_norm = (y - A[1]) / (D[1] - A[1])
|
||||||
|
@ -87,7 +87,11 @@ export default function FaceLibrary() {
|
|||||||
|
|
||||||
const faces = useMemo<string[]>(
|
const faces = useMemo<string[]>(
|
||||||
() =>
|
() =>
|
||||||
faceData ? Object.keys(faceData).filter((face) => face != "train") : [],
|
faceData
|
||||||
|
? Object.keys(faceData)
|
||||||
|
.filter((face) => face != "train")
|
||||||
|
.sort()
|
||||||
|
: [],
|
||||||
[faceData],
|
[faceData],
|
||||||
);
|
);
|
||||||
const faceImages = useMemo<string[]>(
|
const faceImages = useMemo<string[]>(
|
||||||
|
Loading…
Reference in New Issue
Block a user