nischi / MMM-Face-Reco-DNN

Face recognition with opencv and deep neural network
MIT License
91 stars 46 forks source link

"UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position " #45

Closed astvoc closed 4 years ago

astvoc commented 4 years ago

Hi, i have encountered a problem where whenever i run the magic mirror, the facial recognition module would return [2020-06-29 05:01:19.553] [ERROR] PythonShellError: UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 4: ordinal not in range(128) at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:260:21) at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:139:32) at ChildProcess.<anonymous> (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:131:13) at ChildProcess.emit (events.js:200:13) at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12) ----- Python Traceback ----- File "modules/MMM-Face-Reco-DNN/tools/facerecognition.py", line 70, in <module> data = pickle.loads(open(args["encodings"], "rb").read()) { traceback: 'Traceback (most recent call last):\n File ' + '"modules/MMM-Face-Reco-DNN/tools/facerecognition.py", line 70, in ' + '<module>\n data = pickle.loads(open(args["encodings"], "rb").read())\n' + "UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position " + '4: ordinal not in range(128)\n', executable: 'python3', options: null, script: 'modules/MMM-Face-Reco-DNN/tools/facerecognition.py', args: [ '--cascade=modules/MMM-Face-Reco-DNN/tools/haarcascade_frontalface_default.xml', '--encodings=modules/MMM-Face-Reco-DNN/tools/encodings.pickle', '--usePiCamera=1', '--source=0', '--rotateCamera=0', '--method=dnn', '--detectionMethod=hog', '--interval=2000', '--output=0', '--extendDataset=False', '--dataset=modules/MMM-Face-Reco-DNN/dataset/'

when i run the encoding.py and the facialrecognition.py individually it works no problem. but the problem arises when opening the magic mirror.

as a test, i tried emptying the dataset folder and ran encoding.py, and confirmed that when running facialrecognition.py, my face is detected as unknown.

when i tried running the magic mirror, it shows hello stranger message.

so i guess there might be something in the encoding process of the images? the pickle process perhaps?

thank you for your time

astvoc commented 4 years ago

found the problem, apparently i have to run the encode.py in python3