Liveness Detection with OpenCV


Experimenting with Liveness Detection with OpenCV


macOS (same error in Windows below + same solution)

Traceback (most recent call last):
  File "train_liveness.py", line 114, in 
    plt.plot(np.arange(0, EPOCHS), H.history["acc"], label="train_acc")
KeyError: 'acc'

Convolutional Neural Net-Keras-val_acc Keyerror ‘acc’
SOLUTION
from keras source : warnings.warn('The “show_accuracy” argument is deprecated, ’ 'instead you should pass the “accuracy” metric to ’ ‘the model at compile time:’ ‘ model.compile(optimizer, loss, ' 'metrics=["accuracy"]) ’)
The right way to get the accuracy is indeed to compile your model like this:
model.compile(loss=‘categorical_crossentropy’, optimizer=‘adadelta’, metrics=[“accuracy”])

Windows 10 + Anaconda3-5.3.1-64 bit + OpenCV-4.1.2-py37 (3.7.4)


Tensorflow 2.1.0 not working TensorFlow 2.1: ImportError: DLL load failed: The specified module could not be found. #35749
  File "C:\Development\Python\Python37\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Development\Python\Python37\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

SOLUTION
pip install tensorflow==2.0