thearn / webcam-pulse-detector

A python application that detects and highlights the heart-rate of an individual (using only their own webcam) in real-time.
Other
3.16k stars 597 forks source link

Issues running get_pulse.py on osx (10.10) #28

Closed orgicus closed 9 years ago

orgicus commented 9 years ago

Hi,

This looks great, but I've been having some issues running the code. I've activated openmdao in the downloads folder then tried to run the get_pulse.py script but I run into these errors:

Traceback (most recent call last):
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/assembly.py", line 1495, in _setup
    self.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/assembly.py", line 1213, in setup_sizes
    self._system.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 453, in setup_sizes
    sub.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 927, in setup_sizes
    super(SimpleSystem, self).setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 453, in setup_sizes
    sub.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 453, in setup_sizes
    sub.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 933, in setup_sizes
    self.scope.raise_exception(msg, ValueError)
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/container.py", line 1353, in raise_exception
    raise exception_class(full_msg)
ValueError: : RGBsplitter.G was not initialized. OpenMDAO does not support uninitialized variables.
Traceback (most recent call last):
  File "../../webcam-pulse-detector/get_pulse.py", line 151, in <module>
    App.main_loop()
  File "../../webcam-pulse-detector/get_pulse.py", line 134, in main_loop
    self.processor.run()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/component.py", line 509, in run
    self._pre_execute()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/assembly.py", line 200, in _pre_execute
    self._setup()  # only call _setup from top level
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/assembly.py", line 1495, in _setup
    self.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/assembly.py", line 1213, in setup_sizes
    self._system.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 453, in setup_sizes
    sub.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 927, in setup_sizes
    super(SimpleSystem, self).setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 453, in setup_sizes
    sub.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 453, in setup_sizes
    sub.setup_sizes()
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/systems.py", line 933, in setup_sizes
    self.scope.raise_exception(msg, ValueError)
  File "/Users/georgeprofenza/Downloads/openmdao-0.12.0/lib/python2.7/site-packages/openmdao.main-0.12.0-py2.7.egg/openmdao/main/container.py", line 1353, in raise_exception
    raise exception_class(full_msg)
ValueError: : RGBsplitter.G was not initialized. OpenMDAO does not support uninitialized variables.

Any ideas on how initialise these variables and get script running ?

Thanks, George

rcompton commented 9 years ago

I hit the same thing in Ubuntu last night. Did you test your openmdao installation? For some reason openmdao 12 tests gave me warnings. I downgraded to openmdao-10.3.2 and everything worked fine. cf https://github.com/thearn/webcam-pulse-detector/issues/29

thearn commented 9 years ago

Yeah, changes in OpenMDAO 0.12 require that all array variables be pre-sized before execution, which causes trouble in this application as-is. But using an earlier version of the framework (or running from the no_openmdao branch) will work for now.