mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix handling mixed masks (#11157)
This commit is contained in:
parent
5bc9f9a388
commit
0c8e155afa
@ -155,14 +155,18 @@ def get_relative_coordinates(
|
|||||||
relative_masks = []
|
relative_masks = []
|
||||||
for m in mask:
|
for m in mask:
|
||||||
points = m.split(",")
|
points = m.split(",")
|
||||||
relative_masks.append(
|
|
||||||
",".join(
|
if any(x > "1.0" for x in points):
|
||||||
[
|
relative_masks.append(
|
||||||
f"{round(int(points[i]) / frame_shape[1], 3)},{round(int(points[i + 1]) / frame_shape[0], 3)}"
|
",".join(
|
||||||
for i in range(0, len(points), 2)
|
[
|
||||||
]
|
f"{round(int(points[i]) / frame_shape[1], 3)},{round(int(points[i + 1]) / frame_shape[0], 3)}"
|
||||||
|
for i in range(0, len(points), 2)
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
else:
|
||||||
|
relative_masks.append(m)
|
||||||
|
|
||||||
mask = relative_masks
|
mask = relative_masks
|
||||||
elif isinstance(mask, str) and any(x > "1.0" for x in mask.split(",")):
|
elif isinstance(mask, str) and any(x > "1.0" for x in mask.split(",")):
|
||||||
|
Loading…
Reference in New Issue
Block a user