luxonis / depthai-experiments

Experimental projects we've done with DepthAI.
MIT License
809 stars 362 forks source link

[gen2-pedestrian-reidentification] Very high delay with multiple people #402

Open kuu22 opened 1 year ago

kuu22 commented 1 year ago

I'm running the gen2-pedestrian-reidentification on an OAK-D and after a few seconds of running, I get a delay of upwards of 3 seconds. However, the FPS reported in the output is still high, around 8 FPS.

My guess is that the output queue fills up and I display old frames, while other, newer frames, are sitting in the queue. I've tried to set the camera FPS to 5 and that mitigates the delay, but I'm trying to get all of the nodes running somewhat synchronously without artificially limiting my camera FPS:

My goal is to setup a pipeline that captures an image from the camera, performs detection and reidentification and sends everything to the host before capturing the next image, so everything waits until the whole pipeline is complete. I'm guessing this would lower the FPS but latency is more important in my application.

Is there any way I could do this? I've tried setting smaller queues in the output but it ends up freezing after a couple of seconds.

Erol444 commented 1 year ago

Hi @kuu22 , I apologize for the delay here. The main reason for the delay is the inference time of the reid model, and when having multiple people, each person will be cropped from the high-resolution frame and sent to the reid model. Unfortunately, I don't see any good solution for this problem. You could set node input queues to 1 (docs here) but I'm not sure whether this will help any more than to just lowering FPS. Thoughts? Thanks, Erik