GCV time.sleep()

GCV scripting for Gtuner IV and Titan Two. Configuration, examples, questions.

GCV time.sleep()

Postby Scoonix » Mon Jun 20, 2022 11:27 am

Hi,

I've made a gcv script (python) and operations related to time don't seem to work.

Even a simple
def process(self, frame):
time.sleep(10)
doesn't work.

Is there some kind of multi-threading/multiprocess in GCVWorker (or gtuner) when I start computer vision processing ?

Thanks for any reply.
User avatar
Scoonix
Staff Sergeant
Staff Sergeant
 
Posts: 14
Joined: Sun Jul 26, 2020 2:51 pm

Re: GCV time.sleep()

Postby Scachi » Mon Jun 20, 2022 7:49 pm

it is like using main {} in gpc.. using any kind of sleep or while(1) loop in process() is a bad idea.

not 100% correct but it works something like that:
when you get 60fps in gtuner computer vision the gcv scripts "process(self, frame)" get called around each 16-18ms (every new frame) and returns image/gcvdata back to gtuner.

when you want to run something every n time or n process function calls only then add some manual time tracking code
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: GCV time.sleep()

Postby Scoonix » Tue Jun 21, 2022 12:16 am

Thanks for the explaination about how preccess() is called.

I just used time.sleep() to make basics tests about what's working or not when executing a python script via gtuner (as I might load some rnn-lstm that take some time to initialize).

Now I that have a better understanding of the procees and I know how to synchronize everything.

Kind regards,
scoonix
User avatar
Scoonix
Staff Sergeant
Staff Sergeant
 
Posts: 14
Joined: Sun Jul 26, 2020 2:51 pm


Return to Gtuner Computer Vision

Who is online

Users browsing this forum: No registered users and 65 guests