project-posenet
project-posenet copied to clipboard
Lag on video inference with Pi 4 and Coral USB
Hello. I am using a Pi 4B with the Coral USB. The screen reports I'm getting around 22fps, which is great, but there is a 1-second lag between action and response. For instance, I will move my arm up, and the video on screen only responds one second later. This does not happen normally (for instance when I use raspistill -p the camera operates without the lag). The one-second lag may not seem like much, but it makes the project unusable for my purposes. Do you have any recommendations for how I can get rid of that one-second lag, or at least reduce it significantly? Thank you for your help.
hi @Tylersuard how are you running it?
is it just python3 pose_camera.py or any additional arguments?
Hi @Namburger , thank you for the quick response. I am pretty sure I just used the command with no arguments, I will double-check for you asap. Here is a video of someone else having the same issue: https://youtu.be/h8MJpsoge0Q?t=73 Notice how the frame rate is 60 FPS, but the machine takes around 1 second to respond when the user moves his hands... shouldn't it only take 1/60 of a second to respond? I'm trying to figure out a way to reduce that latency. Thank you for your help.
I found out the issue: the lag disappears when I draw fewer edges using svgwrite. Is there a reason you used svgwrite instead of opencv?
@Tylersuard I tested openCV with camera examples and object tracker, performance was being deteriorated with openCV.