I have created a video object detection model using detectron2. My detectron2 model is able to properly do inference in the video.
But I would like to now count the number of detected classes as the video progresses.
I have tried exploring supervision, but would like to get help on how to implement this.
Thanks in advance
The video it produces has the below issues that I would like help on;
sv.process_video() has only made predictions on the first frame neglecting the other frames. And by the way the original video is 6sec long with 181 frames. When I open the newly created video, it definitely doesn’t show other frames and it’s not a continuous video
How can I widen the polygon size(coordinates) so that I can create a polygon for the whole frame. As you can see from the above pic, the polygon shape is in white color. I want to enlarge that so that I can detect more objects in the frame
Thanks and I would like to get your support on this.
The Supervision process_video function provides the video frame and video frame number to the callback, in this case, your process_frame function. Within this function, you should not need to modify the frame variable, yet within your code, you create a Supervision frame generator on every iteration of your video, which returns the first frame.
What that means is this portion of your code is unnecessary and overwrites the frame variable with the first frame, regardless of when it actually is.