webcam-pulse-detector icon indicating copy to clipboard operation
webcam-pulse-detector copied to clipboard

argmax?

Open francksa opened this issue 10 years ago • 11 comments

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?

francksa avatar Mar 13 '14 21:03 francksa

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

thearn avatar Mar 13 '14 21:03 thearn

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 [email protected] 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.

francksa avatar Mar 13 '14 22:03 francksa

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 avatar Apr 15 '14 13:04 delijati

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

delijati avatar Apr 15 '14 13:04 delijati

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.

thearn avatar Apr 15 '14 16:04 thearn

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.

DougHuggem avatar Apr 20 '14 22:04 DougHuggem

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

venthur avatar May 18 '14 11:05 venthur

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 avatar Jan 03 '17 15:01 gadLinux

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

gadLinux avatar Jan 03 '17 15:01 gadLinux

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

enochdongyi avatar Apr 07 '17 20:04 enochdongyi

guvcview

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

SkyRatInd avatar Nov 20 '18 21:11 SkyRatInd