ageitgey / face_recognition

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

face recognition only real faces not fake #180

Closed ahmadRagheb closed 6 years ago

ahmadRagheb commented 6 years ago

hi , i use the cam example and i really want to know how to tell the difference between a real person and someone holding his image? i could you tell me if there is a way to make the 'face_recognition ' know the difference between real person and a picture of him .. and label them as fake or pictures

ageitgey commented 6 years ago

One option is to use blink detection and make the user blink to show they aren't a photo.

ahmadRagheb commented 6 years ago

thank you very much ageitgey i will read more about it .

ahmadRagheb commented 6 years ago

@ageitgey i did the demo it was great thanks , when i use vs= VideoStream(src=0).start() to open the webcam windows and try to pass the video instead of video_capture = cv2.VideoCapture(0) ret, frame = video_capture.read()

it tell there is a lot of values to unpack ?

ret, frame = video_capture.read()

ValueError: too many values to unpack

cyberdrk commented 6 years ago

Is it possible to differentiate between a human and an image without using blink detection, purely from the src image? @ageitgey

ageitgey commented 6 years ago

@ahmadRagheb I'm not sure. Try result = video_capture.read() and debugging what result contains on your system.

@cyberdrk Maybe, but I don't know how myself. For example the new iPhone uses depth data to prevent 2d photos from tricking their system. But that requires extra hardware and a different kind of model than used in this project.

MLDSBigGuy commented 6 years ago

What if a robot face blinks ? How to handle this fake condition ? Any ideas ?

hasanlatif commented 6 years ago

may be by using emotion detectors.we can tackle this condition. have a look at this

MLDSBigGuy commented 6 years ago

ok. How about a humanoid robot ? No, i am just kidding :D A 3d human mask of my friends face with eyes cut out so that i can blink with my eyes is sufficient to fake. No need to take robots help i guess.

elyselam commented 6 years ago

@ahmadRagheb Hey, did you figure it out? i actually was putting 2 scripts together and just kept "frame" from the detect_blink.py and commented out the rest that was related to face_recog video_capture. Couldn't get it to work :/

Coldrog commented 5 years ago

Hey! Is it possible to update the database with some values like updating present in attendance column by detecting the blinking face detection. If yes, how?

ghost commented 5 years ago

Yes,

if(TOTAL == 3):

ANYTHING HERE

cam.release() cv2.destroyAllWindows() break

Kamelia2000 commented 5 years ago

Hello this is Kamelia anyone know any library for face recognition possible to make cluster also possible to find difference between a picture of a person and live.I mean understand this is a picture to recognize

Thanks, Kamelia

ajaymin28 commented 4 years ago

Hello this is Kamelia anyone know any library for face recognition possible to make cluster also possible to find difference between a picture of a person and live.I mean understand this is a picture to recognize

Thanks, Kamelia

Use Sklearn(Machine Learning Lib) for clustering and face_reconition from github for extracting face features, feed the features to DCSCAN algorithm to generate clusters.

ajaymin28 commented 4 years ago

Is it possible to differentiate between a human and an image without using blink detection, purely from the src image? @ageitgey

Best idea is to use stereo vision cameras to identify 3d face and 2d face.