Closed ChrizZz90 closed 4 years ago
See #17 for the pictures in the "unknown" folder. 640x480 should be fine. Pictures are rescaled to 500px anyway for faster face detection...
Yes thats because the OpenCV detect a face. The detection is not perfect. Which method do you use for face detection?
I think it's possible to increase the resolution, but it will be much slower. And i'm not sure it would be better recognition after that.
Images are rescaled to 500px anyway https://github.com/nischi/MMM-Face-Reco-DNN/blob/c1ae77529d2264b365766133a14a50affb897c41/tools/facerecognition.py#L94-L97 so I suspect a higher resolution would no make much of a difference. It might be better to make sure you use the newer DNN, not the HaarCascades method and add some more training pictures and update you encodings (see README).
I use DNN and I have lots of training pictures (400+). Maybe the problem is that I use a widescreen camera?
dnn is the recognition method (i realized that i wrote it a little bit wrong in the readme) the "detectionMethod" is the detection of the face which make some issues here. which settings do you have? hog
or cnn
?
Ah alright, I use hog. So I should try cnn, right?
yes, give a try
so I changed to cnn, created new embeddings with "python3 encode.py" and now my MM doesn't recognize anything. Do I have to add "-d cnn" by creating new embeddings?
its not necessary, should also work without. thats only how to detect faces while check your pictures. if that isnt a problem, you dont need to
after changing the type this modul doesn't recognize anything
any error message?
`[16:24:30.878] [ERROR] { Error: MemoryError: std::bad_alloc
at PythonShell.parseError (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:246:21)
at terminateIfNeeded (/home/pi/MagicMirror/modules/MMM-Face-Reco-DNN/node_modules/python-shell/index.js:129:32)
at ChildProcess.
----- Python Traceback -----
File "modules/MMM-Face-Reco-DNN/tools/facerecognition.py", line 106, in <module>
model=args["detectionMethod"])
File "/usr/local/lib/python3.7/dist-packages/face_recognition/api.py", line 116, in face_locations
return [_trim_css_to_bounds(_rect_to_css(face.rect), img.shape) for face in _raw_face_locations(img, number_of_times_to_upsample, "cnn")]
File "/usr/local/lib/python3.7/dist-packages/face_recognition/api.py", line 100, in _raw_face_locations
return cnn_face_detector(img, number_of_times_to_upsample)
traceback:
'Traceback (most recent call last):\n File "modules/MMM-Face-Reco-DNN/tools/facerecognition.py", line 106, in
phu seems like a RAM issue. Do you use the "old" Raspberry Pi 3?
yes I use a Raspberry Pi 3 - 350 MB of 874 MB RAM is used when MM is running
maybe an issue with the swap file. but you shouldnt have this to high, otherwise you can burn your SD Card. I think Raspi 3 has to less power for dnn cnn
Close it because no activity here. If still a case, you can reopen it.
I receive failed recognitions with a really different looking person and I saw that the module saves recognized pictures without anyone in front of the cam.
Is it possible that the picture resolution 640x480px is too low to create a database? Is there a way to increase the resolution?