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.14k stars 592 forks source link

argmax? #25

Open francksa opened 10 years ago

francksa commented 10 years ago

Trying to use under windows 7. INstalls OK but freezes after i lock the forehead:

ValueError: attempt to get argmax of an empty sequence....

thoughts?

thearn commented 10 years ago

In the traceback for the error, does it come from lib/interface.py or lib/signalprocess.py?

francksa commented 10 years ago

Thanks!

I first get: warning file already exists but should not: c:.....temp/_MEI82562/include/pyconfig.h

But I get the stream

Then I press s to lock the forehead, it freezes and gives me...

Hang on...now it works!,!,,,!! Only difference is that the lighting is more intense....could it be it?

Oh no, I tried again and the error is:

File:/ d:/webcam-pulse-detector/build/get_pulse_win/out00-PYZ/jumpy.core.fromnumeric",line 738, in armax

This is great work Thanks much Franck

Sent from my iPad

On Mar 13, 2014, at 5:58 PM, Tristan Hearn notifications@github.com wrote:

In the traceback for the error, does it come from lib/interface.py or lib/signalprocess.py?

— Reply to this email directly or view it on GitHub.

delijati commented 10 years ago

in no_openmdau branch after pressing 'S'

Traceback (most recent call last):
  File "get_pulse.py", line 212, in <module>
    App.main_loop()
  File "get_pulse.py", line 180, in main_loop
    self.processor.run(self.selected_cam)
  File "/opt/develop/private/webcam-pulse-detector/lib/processors_noopenmdao.py", line 208, in run
    idx2 = np.argmax(pruned)
  File "/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 932, in argmax
    return argmax(axis)
ValueError: attempt to get argmax of an empty sequence
delijati commented 10 years ago

I changed the frequency to idx = np.where((freqs > 50) & (freqs < 240)) and it works now ... or at least i think ;) need to check it with a normal pulse detector

thearn commented 10 years ago

Good to hear; this step in the code could be optimized in a few different ways too. I need to look it over again and re-implement for performance.

DougHuggem commented 10 years ago

Having this same issue with trace:

HIGHGUI ERROR: V4L: index 1 is not correct! face detection lock = True Traceback (most recent call last): File "get_pulse.py", line 212, in App.main_loop() File "get_pulse.py", line 180, in main_loop self.processor.run(self.selected_cam) File "/home/citizensnips/Documents/MSD/web/public/Documentation/Design_Meetings/Detailed_Design/Software Design/Demo_Code/Heart_Rate/lib/processors_noopenmdao.py", line 208, in run idx2 = np.argmax(pruned) File "/usr/lib/pymodules/python2.7/numpy/core/fromnumeric.py", line 738, in argmax return argmax(axis) ValueError: attempt to get argmax of an empty sequence

I'll try the frequency change and report on how that goes.

venthur commented 10 years ago

Same problem, the idx = np.where((freqs > 50) & (freqs < 240)) fixed the problem here as well.

gadLinux commented 7 years ago

Hi, not for me... face detection lock = True Traceback (most recent call last): File "get_pulse.py", line 212, in App.main_loop() File "get_pulse.py", line 180, in main_loop self.processor.run(self.selected_cam) File "/mnt/optional-disk/gad/git/webcam-pulse-detector/lib/processors_noopenmdao.py", line 208, in run idx2 = np.argmax(pruned) File "/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 974, in argmax return argmax(axis, out) ValueError: attempt to get argmax of an empty sequence

I tried... Just in case

        idx = np.where((freqs > 20) & (freqs < 240))
gadLinux commented 7 years ago

Adjusting camera settings with guvcview once the program started seems to make the trick.

enochdongyi commented 7 years ago

in processors_noopenmdao.py line 185

  if L > 10:
            self.output_dim = processed.shape[0]
            # print "ready"

change L>10 to larger number (I change it to L>50) The error occurred when the frequency domain do not have frequency in the selected range. With higher initial sampling range, the problem can be fixed

SkyRatInd commented 5 years ago

guvcview

I'm having the same error you were having, could u describe you you fixed it with a little more detail?