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

Python build crashes when locking to face #51

Open SkyRatInd opened 6 years ago

SkyRatInd commented 6 years ago

Same issue as previous but different debug, this time I'm not running the exe I built from python

face detection lock = True
Traceback (most recent call last):
  File "get_pulse.py", line 213, in <module>
    App.main_loop()
  File "get_pulse.py", line 181, in main_loop
    self.processor.run(self.selected_cam)
  File "C:\Users\WorldMachine\Downloads\webcam-pulse-detector-no_openmdao\lib\processors_noopenmdao.py", line 207, in run
    idx2 = np.argmax(pruned)
  File "C:\Users\WorldMachine\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\fromnumeric.py", line 1037, in argmax
    return _wrapfunc(a, 'argmax', axis=axis, out=out)
  File "C:\Users\WorldMachine\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\fromnumeric.py", line 51, in _wrapfunc
    return getattr(obj, method)(*args, **kwds)
ValueError: attempt to get argmax of an empty sequence
wgaylord commented 6 years ago

Is is also affecting the exe versions.

Saurav-K-Aryal commented 5 years ago

@SkyRatInd @wgaylord @thearn Any solution for this so far? Facing the same problem on Ubuntu 18.04, python 3.6.7.

RahanSharma commented 5 years ago

I have also encountered this error.Hence looked through the code and found that it is because of low fps camera.In code when I remove the lower bound or increase the upper bound then the issue is resolved idx = np.where((freqs > 50) & (freqs < 180)) line number 199 in processors_noopenmdao.py however this effects the output and hence the BPM calculated is very inaccurate .

wgaylord commented 5 years ago

Most webcams are 23 or so FPS (basically bear min.)

On Apr 9, 2019, at 10:48 AM, RahanSharma notifications@github.com wrote:

I have also encountered this error.Hence looked through the code and found that it is because of low fps camera.In code when I remove the lower bound or increase the upper bound then the issue is resolved idx = np.where((freqs > 50) & (freqs < 180)) line number 199 in processors_noopenmdao.py however this effects the output and hence the BPM calculated is very inaccurate .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

RahanSharma commented 5 years ago

just solved it out.It is basically because of temp file created in temp folder ,Try removing it and it will work .Temp files are the root of the problem.

ghost commented 5 years ago

@RahanSharma, can you tell us what temp file you are talking about?

SijinJohn commented 5 years ago

@RahanSharma , where are the temp files??

Chiboom commented 4 years ago

How to solve this problem? I have tried 2 cams, 24fps and 60fps, both didn't work......

zpisar commented 3 years ago

Same issue here. I'm on Win10, Python v3.7.0 using built in camera.

MarkusvonStaden commented 2 years ago

Temp files seems possible, since it worked the first time, but I cannot find any tempfiles

Chiboom commented 2 years ago

你好!你的信件已收到,我会尽快回复!