-
I did the recognition, it works great when the area is equal to the entire screen.
Now I need to make 4 zones inside the frame. I used this https://roboflow.github.io/polygonzone/ and got the data. I put them instead of the first option, and I get an error. I tried the possible options, but I get an error. ZONE_POLYGON = np.array([[[0.04, 0.03],[0.42, 0.03],[0.41, 0.51],[0.05, 0.51]],
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @epigraphe 👋🏻 The problem is that you simultaneously pass the coordinates of all import numpy as np
import supervision as sv
ZONE_POLYGONS = np.array([
[[0.04, 0.03], [0.42, 0.03], [0.41, 0.51], [0.05, 0.51]],
[[0.49, 0.03], [0.96, 0.03], [0.96, 0.51], [0.5, 0.51]],
[[0.05, 0.61], [0.41, 0.6], [0.4, 0.94], [0.04, 0.94]],
[[0.5, 0.61], [0.95, 0.61], [0.94, 0.91], [0.49, 0.92]]
])
ZONE_POLYGONS = (ZONE_POLYGONS * np.array([width, frame_height])).astype(int)
zones = [
sv.PolygonZone(
polygon=polygon,
frame_resolution_wh=(frame_width, frame_height)
)
for polygon in ZONE_POLYGONS
] |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, everything worked. |
Beta Was this translation helpful? Give feedback.
Hi @epigraphe 👋🏻 The problem is that you simultaneously pass the coordinates of all
PolygonZone
's. You need to separate polygons and initiate eachPolygonZone
separately.