#1
|
|||
|
|||
How to use Multiprocessing
hi sir,
I am currently working in vizard where i try to develop an application in which it has to monitor blink detection of the user as well as the region of interest towards avatar face. I have both the functions done and working well. Now what i have to do its to make the two functions run at the same time using some MULTIPROCESSING. I try to use vizmultiprocess but still i could't get and idea how to work on it. Please kindly help me to resolve this problem |
#2
|
|||
|
|||
You can have multiple functions registered with different vizact.onupdate and vizact.ontimer commands running at the same time. That maybe all you need for your application. How are you currently calling these functions?
|
#3
|
|||
|
|||
Now i simply try calling the functions using the multiprocessing in actual python code. but it doesn't works. and now i tried using vizmultiprocess but still i dono how to use it exactly. The blinkdetection() and regionofinterest() are my two functions which has to be run independently from each other and it should start at same time and end at same time when i try to execute where the blinkdetection() function has to run at the background. Is it possible to do here.
|
#4
|
|||
|
|||
Even i tried with ontimer() function as given in help document of vizard. But i cant get any output from that. It was simply static
import vizact def Blink_Detection() print 'inside blink detection function' ............ some process........... .................... vizact.ontimer2(3,3,Blink_Detection) but this code does not give any output. Could you please correct me where i should change my mistakes in the code. And also help me to add another function along with my code (say RegionofInterest()) thank you, |
#5
|
|||
|
|||
Hello,
Can the scenario what i try to tell can be possible. If so please kindly help telling me as early as possible. I m struck out with my work because of this.... Thank you. |
#6
|
|||
|
|||
This is possible but it's difficult to know what the problem is without seeing more code. The Blink_Detection function should get called 4 times (1 + 3 repeats). Are you getting an error in your script?
|
#7
|
|||
|
|||
I am not getting any error but when i use vizmultiprocess or multiprocessing option in python the functions are not running parallel rather one function get executed fully first and then second one starts.
|
#8
|
|||
|
|||
In the following example code both functions get called once a second. Is this along the lines of what you're trying to do?
Code:
import viz import vizact viz.go() def Blink_Detection(): print 'inside blink detection' def Region_of_Interest(): print 'inside region of interest' vizact.ontimer(1,Blink_Detection) vizact.ontimer(1,Region_of_Interest) |
#9
|
|||
|
|||
Hi,
Ya Thanks a lot it works but still some real-time data that i get from the eye-tracker but since the time gap between the each function to be called. I hope this might be sufficient if still more any other options available could you please tell me. Thank you |
Tags |
multiprocessing, vizmultiprocess |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiprocessing Process | sleiN13 | Vizard | 2 | 08-01-2011 05:47 AM |