ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.44k stars 13.49k forks source link

didn't find a face #645

Open rw86347 opened 6 years ago

rw86347 commented 6 years ago

Description

I had been using your virtual machine ... Thank you BTW. Then I modified one of your scripts ever so slightly so that I could separate the training and the recognition. Everything worked wonderfully except the performance. I then purchased a machine with 5 GPUs. I installed Ubuntu 16.04 and tensorflow-gpu. Now when I train I get the following...

train_dir = knn_examples/train Traceback (most recent call last): File "train.py", line 86, in knn_clf = train("knn_examples/train") File "train.py", line 22, in train faces_bboxes = face_locations(image) File "/home/rwilson/.local/lib/python3.5/site-packages/face_recognition/api.py", line 77, in face_locations return [_rect_to_css(face) for face in _raw_face_locations(img, number_of_times_to_upsample)] File "/home/rwilson/.local/lib/python3.5/site-packages/face_recognition/api.py", line 66, in _raw_face_locations return face_detector(img, number_of_times_to_upsample) RuntimeError: Unsupported image type, must be 8bit gray or RGB image.

Since everything is Identical I assume that something is wrong with my setup. Maybe a wrong version of something.

pip3 freeze apturl==0.5.2 beautifulsoup4==4.4.1 blinker==1.3 Brlapi==0.6.4 chardet==2.3.0 checkbox-support==0.22 Click==7.0 cloudpickle==0.6.0 command-not-found==0.3 cryptography==1.2.3 cycler==0.10.0 dask==0.19.3 decorator==4.3.0 defer==1.0.6 dlib==19.16.0 face-recognition==1.2.3 face-recognition-models==0.3.0 feedparser==5.1.3 guacamole==0.9.2 html5lib==0.999 httplib2==0.9.1 idna==2.0 Jinja2==2.8 kiwisolver==1.0.1 language-selector==0.1 louis==2.6.4 lxml==3.5.0 Mako==1.0.3 MarkupSafe==0.23 matplotlib==3.0.0 networkx==2.2 numpy==1.15.2 oauthlib==1.0.3 onboard==1.2.0 padme==1.1.1 pexpect==4.0.1 Pillow==5.3.0 plainbox==0.25 ptyprocess==0.5 pyasn1==0.1.9 pycups==1.9.73 pycurl==7.43.0 pygobject==3.20.0 PyJWT==1.3.0 pyparsing==2.2.2 python-apt==1.1.0b1+ubuntu0.16.4.2 python-dateutil==2.7.3 python-debian==0.1.27 python-systemd==231 PyWavelets==1.0.1 pyxdg==0.25 reportlab==3.3.0 requests==2.9.1 scikit-image==0.14.1 scikit-learn==0.20.0 scipy==1.1.0 screen-resolution-extra==0.0.0 sessioninstaller==0.0.0 six==1.11.0 sklearn==0.0 ssh-import-id==5.5 system-service==0.3 toolz==0.9.0 ubuntu-drivers-common==0.0.0 ufw==0.35 unattended-upgrades==0.1 unity-scope-calculator==0.1 unity-scope-chromiumbookmarks==0.1 unity-scope-colourlovers==0.1 unity-scope-devhelp==0.1 unity-scope-firefoxbookmarks==0.1 unity-scope-gdrive==0.7 unity-scope-manpages==0.1 unity-scope-openclipart==0.1 unity-scope-texdoc==0.1 unity-scope-tomboy==0.1 unity-scope-virtualbox==0.1 unity-scope-yelp==0.1 unity-scope-zotero==0.1 urllib3==1.13.1 usb-creator==0.3.0 xdiagnose==3.8.4.1 xkit==0.0.0 XlsxWriter==0.7.3

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
kcjevin commented 6 years ago

The reason why you can't recognize your face may be that the definition of the picture is not enough.

At 2018-10-10 08:26:35, "Rodger Wilson" notifications@github.com wrote:

face_recognition version: 1.2.3 Python version: 3.5 Operating System: Ubuntu 16.04 Description

I had been using your virtual machine ... Thank you BTW. Then I modified one of your scripts ever so slightly so that I could separate the training and the recognition. Everything worked wonderfully except the performance. I then purchased a machine with 5 GPUs. I installed Ubuntu 16.04 and tensorflow-gpu. Now when I train I get the following...

image knn_examples/train/SamSecurity/1537462148390.png not fit for training: didn't find a face image knn_examples/train/SamSecurity/1537462147959.png not fit for training: didn't find a face image knn_examples/train/SamSecurity/1537462152251.png not fit for training: didn't find a face

Since everything is Identical I assume that something is wrong with my setup. Maybe a wrong version of something.

pip3 freeze apturl==0.5.2 beautifulsoup4==4.4.1 blinker==1.3 Brlapi==0.6.4 chardet==2.3.0 checkbox-support==0.22 Click==7.0 cloudpickle==0.6.0 command-not-found==0.3 cryptography==1.2.3 cycler==0.10.0 dask==0.19.3 decorator==4.3.0 defer==1.0.6 dlib==19.16.0 face-recognition==1.2.3 face-recognition-models==0.3.0 feedparser==5.1.3 guacamole==0.9.2 html5lib==0.999 httplib2==0.9.1 idna==2.0 Jinja2==2.8 kiwisolver==1.0.1 language-selector==0.1 louis==2.6.4 lxml==3.5.0 Mako==1.0.3 MarkupSafe==0.23 matplotlib==3.0.0 networkx==2.2 numpy==1.15.2 oauthlib==1.0.3 onboard==1.2.0 padme==1.1.1 pexpect==4.0.1 Pillow==5.3.0 plainbox==0.25 ptyprocess==0.5 pyasn1==0.1.9 pycups==1.9.73 pycurl==7.43.0 pygobject==3.20.0 PyJWT==1.3.0 pyparsing==2.2.2 python-apt==1.1.0b1+ubuntu0.16.4.2 python-dateutil==2.7.3 python-debian==0.1.27 python-systemd==231 PyWavelets==1.0.1 pyxdg==0.25 reportlab==3.3.0 requests==2.9.1 scikit-image==0.14.1 scikit-learn==0.20.0 scipy==1.1.0 screen-resolution-extra==0.0.0 sessioninstaller==0.0.0 six==1.11.0 sklearn==0.0 ssh-import-id==5.5 system-service==0.3 toolz==0.9.0 ubuntu-drivers-common==0.0.0 ufw==0.35 unattended-upgrades==0.1 unity-scope-calculator==0.1 unity-scope-chromiumbookmarks==0.1 unity-scope-colourlovers==0.1 unity-scope-devhelp==0.1 unity-scope-firefoxbookmarks==0.1 unity-scope-gdrive==0.7 unity-scope-manpages==0.1 unity-scope-openclipart==0.1 unity-scope-texdoc==0.1 unity-scope-tomboy==0.1 unity-scope-virtualbox==0.1 unity-scope-yelp==0.1 unity-scope-zotero==0.1 urllib3==1.13.1 usb-creator==0.3.0 xdiagnose==3.8.4.1 xkit==0.0.0 XlsxWriter==0.7.3

What I Did Paste the command(s) you ran and the output. If there was a crash, please include the traceback here.

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

rw86347 commented 6 years ago

You are right. I think cropping unknown faces to train from doesn't quite work. Thank you!

RahulSinghazm commented 6 years ago

import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True): ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()