I am using OpenCV python to detect faces in a video(30fps). The problem is my code runs detection algorithm for each frame in the video, which is slow and inefficient. Is there any way to sample only a few frames from the video that speeds up this process?
Asked
Active
Viewed 202 times
0
-
yes, just skip the frames by using the command "continue". Share your code so that we can help you guide you to what you are trying to achieve – yapws87 Nov 24 '18 at 08:18
1 Answers
0
You can use the frame count to determine if process current frame. Below code for your reference.
if frame_count % 5 == 0:
face_detect(frame)
else:
continue

Quinn
- 31
- 5