thearn/webcam-pulse-detector

Python build crashes when locking to face

Opened this issue · 11 comments

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

Is is also affecting the exe versions.

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

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 .

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.

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

@RahanSharma , where are the temp files??

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

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

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