mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-24 07:24:42 +03:00
Compare mask coordinates numerically (#24666)
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* Compare mask coordinates numerically * Fix zone coordinate comparisons and normalize mask examples * Fix validation errors for malformed zone coordinates
This commit is contained in:
@@ -1000,12 +1000,12 @@ def get_relative_coordinates(
|
||||
# old native resolution coordinates
|
||||
where = f" for camera {camera_name}" if camera_name else ""
|
||||
if mask:
|
||||
if isinstance(mask, list) and any(x > "1.0" for x in mask[0].split(",")):
|
||||
if isinstance(mask, list) and any(float(x) > 1.0 for x in mask[0].split(",")):
|
||||
relative_masks = []
|
||||
for m in mask:
|
||||
points = m.split(",")
|
||||
|
||||
if any(x > "1.0" for x in points):
|
||||
if any(float(x) > 1.0 for x in points):
|
||||
rel_points = []
|
||||
for i in range(0, len(points), 2):
|
||||
x = int(points[i])
|
||||
@@ -1026,7 +1026,7 @@ def get_relative_coordinates(
|
||||
relative_masks.append(m)
|
||||
|
||||
mask = relative_masks
|
||||
elif isinstance(mask, str) and any(x > "1.0" for x in mask.split(",")):
|
||||
elif isinstance(mask, str) and any(float(x) > 1.0 for x in mask.split(",")):
|
||||
points = mask.split(",")
|
||||
rel_points = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user