project-posenet icon indicating copy to clipboard operation
project-posenet copied to clipboard

Lag on video inference with Pi 4 and Coral USB

Open Tylersuard opened this issue 4 years ago • 4 comments

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.

Tylersuard avatar Feb 17 '21 18:02 Tylersuard

hi @Tylersuard how are you running it? is it just python3 pose_camera.py or any additional arguments?

Namburger avatar Feb 18 '21 22:02 Namburger

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.

Tylersuard avatar Feb 19 '21 08:02 Tylersuard

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 avatar Mar 10 '21 06:03 Tylersuard

@Tylersuard I tested openCV with camera examples and object tracker, performance was being deteriorated with openCV.

manoj7410 avatar Jul 05 '21 09:07 manoj7410