WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-23-2014, 03:31 AM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
Post 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
Reply With Quote
  #2  
Old 06-23-2014, 04:04 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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?
Reply With Quote
  #3  
Old 06-23-2014, 07:38 AM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
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.
Reply With Quote
  #4  
Old 06-24-2014, 12:09 AM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
Post

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,
Reply With Quote
  #5  
Old 06-25-2014, 03:21 AM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
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.
Reply With Quote
  #6  
Old 06-30-2014, 09:53 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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?
Reply With Quote
  #7  
Old 06-30-2014, 10:21 PM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
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.
Reply With Quote
  #8  
Old 07-01-2014, 11:10 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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)
Reply With Quote
  #9  
Old 07-01-2014, 11:03 PM
pradeep pradeep is offline
Member
 
Join Date: Jun 2014
Posts: 14
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
Reply With Quote
Reply

Tags
multiprocessing, vizmultiprocess

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiprocessing Process sleiN13 Vizard 2 08-01-2011 04:47 AM


All times are GMT -7. The time now is 04:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC