Alright I am having issues with the detection of the objects in a certain zone after I change the size of the window using the openCV.
The default size of the screen is 640 by 640 I want the image /video stream to be the size of my window or make it dynamic.
If I increase the image size by hardcoding the values eg 1080 by 920 the object detection zone points are not scaled .
What is the possible solution for this?
Same is the case with the drawing of the polygon zones
I am using supervision and have a very basic setup
def main(
weight_path: str,
rtsp_url: str,
zone_configuration_path: str,
model_id: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
sink = CustomSink(weights_path=weight_path ,zone_configuration_path=zone_configuration_path, classes=classes)
pipeline = InferencePipeline.init_with_custom_logic(
video_reference=rtsp_url,
on_video_frame=sink.infer,
on_prediction=sink.on_prediction,
# confidence=confidence,
# iou_threshold=iou,
)
try:
pipeline.start()
pipeline.join()
except (KeyboardInterrupt, SystemExit):
pipeline.terminate()
print("Program terminated.")