How to run multi thread in YOLOv3 on nano?

Hello all
Now, i am using YOLOv3 to do the object detection on Jetson nano. But i want to change the code to achieve the goal: If detect the person then control one relay to cut the power 2 seconds. But i don’t know how to change the code. I try to create threat using pthread_create() and sleep 2 seconds. But it have influence on real-time detection. Is there somebody could help me?Looking forward to your reply!
Thank you in advance!!!

Hi,

Maybe you can separate the inference part with a thread.

Generate a thread when a frame arrives and terminate it after inferencing.
Once a person detected, freeze the process with two seconds.

Thanks.

Hello AastaLLL
I am not fimiliar with how to separate the inference. Do you have another way to achieve my goal?

Hi,

What kind of source do you use?
Is it darknet? Or TensorRT? Or others?

Thanks.

hello
I use darknet.

Hi,

It looks like darknet executes the inference with the function call like this:
https://github.com/pjreddie/darknet/blob/master/examples/detector.py#L19

r = dn.detect(net, meta, "data/eagle.jpg")

So you can add some mechanism on this to achieve temporally sleep.
Thanks.