Face Anti-Spoofing for Facial Recognition in Python

  Рет қаралды 7,377

Sefik Ilkin Serengil

Sefik Ilkin Serengil

Күн бұрын

Пікірлер: 40
@tristdrum-workweek
@tristdrum-workweek 6 ай бұрын
Thank you Sefik! You're contribution to the world is wonderful. I appreciate what you are doing greatly!
@masterspirit
@masterspirit 5 ай бұрын
Serengil, we love you! God bless you!
@MicheleSblendorio
@MicheleSblendorio 6 ай бұрын
Thank you! A really useful and interesting implementation of DeepFace. Ad maiora semper!
@ramyzeidan
@ramyzeidan 5 ай бұрын
Thank you for your video, but im keep getting spoofing even though im using my webcam on me no phones or paper detected? is there away to optimize it to get accurate results? face_objs = DeepFace.extract_faces(img_path=face_img, anti_spoofing=True) for face_obj in face_objs: if not face_obj["is_real"]: # Spoofing detected, draw red rectangle cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2) response_data["message"] = "Spoofing detected." return response_data
@sefiks
@sefiks 5 ай бұрын
That is the most robust model i found :/
@Shaurya-dz4rd
@Shaurya-dz4rd 4 ай бұрын
Hey, can you please tell which loss function is used to train the VGGFace and Facenet models. I require them to build the fine tune pipeline. Thanks!
@sefiks
@sefiks 4 ай бұрын
These are pre-trained models, I didn't train them. You have to investigate this from reference repos which are mentioned in the read me of the deepface.
@JohnCristophereCarlos
@JohnCristophereCarlos 11 күн бұрын
Are there a way to translate this library in javascript or web version, I have a web app and mobile app based in webview and wanted to implement this kind of liveness. Is it possible?
@sefiks
@sefiks 11 күн бұрын
Deep Face Recognition With ReactJS and DeepFace: kzbin.info/www/bejne/f4nSkptsp82rl8U
@JohnCristophereCarlos
@JohnCristophereCarlos 11 күн бұрын
@@sefiks Thank you for the tutorial, this is great. My next question is that given that this is based on the API you call in the backend. On top of my mind is an approach wherein all the valdation for anti-spoofing is within the devices no need to hit the API endpoint so that it can support the offline mode.
@f1ras217
@f1ras217 6 ай бұрын
can anti spoofing be used with the api?
@sefiks
@sefiks 6 ай бұрын
Yes, it can.
@f1ras217
@f1ras217 6 ай бұрын
@@sefiks what should i do? i already set the anti_spoofing = true but it still return the verification result as true. it should be false right if i put the spoofed image
@sefiks
@sefiks 6 ай бұрын
@@f1ras217 it will throw exception if it is fake
@f1ras217
@f1ras217 6 ай бұрын
@@sefiks okay last. what kind of fake image that the model will throw exception? i'm currently using face verification. i tried one image is real, captured using the camera and another one is an image that has been captured from another device and i uploaded it into deepface. is that still count?
@sefiks
@sefiks 6 ай бұрын
Try the one i tested in the video
@f1ras217
@f1ras217 6 ай бұрын
brother, the exception is not thrown inside the api. if i compare image 1 (fake) and image 2 (real), it will not throw any exception and proceed with normal verification like usual. when i tested to compare verify from ipynb, it threw the expected exception. i wanted to use the api because i'm developing a system that utilizes deepface. thank you in advance.
@sefiks
@sefiks 6 ай бұрын
are you using v92? when i tested it as shown, I am getting the following response. I will add more details to the response message tonight. endpoint: localhost:5005/verify body: ``` { "img1_path": "/Users/sefik/Desktop/deepface/tests/dataset/img1.jpg", "img2_path": "/Users/sefik/Desktop/f1.jpeg", "anti_spoofing": true } ``` response: ``` { "error": "Exception while verifying: Exception while processing img2_path" } ```
@f1ras217
@f1ras217 6 ай бұрын
@@sefiks yes, i'm using v92 24-06-11 16:58:47 - Welcome to DeepFace API v0.0.92! endpoint: 127.0.0.1:5000/verify body: { "img1_path": "C:/Users/fiira/face_verification/elul.jpg", "img2_path": "C:/Users/fiira/face_verification/spoofing_example.jpg", "anti_spoofing": "True" } response: { "model": "Facenet", "similarity_metric": "euclidean", "threshold": 10, "time": 32.99, "verified": true } it is still detecting like usual... i'm still figuring out, where did i go wrong 😭
@f1ras217
@f1ras217 6 ай бұрын
@@sefiksyes, i am currently using v92. when i launched the api: 24-06-11 16:58:47 - Welcome to DeepFace API v0.0.92! endpoint: localhost:5000/verify body: ``` { "img1_path": "C:/Users/fiira/face_verification/elul.jpg", "img2_path": "C:/Users/fiira/face_verification/spoofing_example.jpg", "anti_spoofing": "True" } ``` response: ``` { "model": "Facenet", "similarity_metric": "euclidean", "threshold": 10, "time": 6.65, "verified": true } ``` i'm still figuring out, where did i go wrong.
@f1ras217
@f1ras217 6 ай бұрын
@@sefiks yes, i am using v92. i used the same header as you did, with my sample spoofing images. but the response is like this "model": "VGG-Face", "similarity_metric": "cosine", "threshold": 0.68, "time": 5.23, "verified": true
@f1ras217
@f1ras217 5 ай бұрын
ohhhh so basically, if there is a spoofed image has been inserted, the api will return 400 code response?
@sefiks
@sefiks 5 ай бұрын
Yes
@yuryeuceda8590
@yuryeuceda8590 5 ай бұрын
@@sefiks I did a change locally that returns a property with false instead of an exception because in my case is more useful. I have a really really urgent question, can you readme in the comments please
@yuryeuceda8590
@yuryeuceda8590 5 ай бұрын
Hello, great job Sefik, Just now I need to make a fake face detection but when using deepface in my computer it works great, but I need to do it on a serverless function and first, the size of image get big (2GB ~ 8GB) and the memory requirements too (8GB). I want to know how to remove all code except antispoofing module because thats what I only need. Thanks a lot. Currently, we have a serverless function using dlib that performs face detection and face embedding but we need to complement it with another serverless function to make fake face detection score and joining this, we create an integrated service, but Deepface seems to be too big in order to be deployed as a serverless function.
@sefiks
@sefiks 5 ай бұрын
@@yuryeuceda8590 then deepface may not be the right tool for you. Recommend to use anti spoofing repo directly: github.com/minivision-ai/Silent-Face-Anti-Spoofing
@yuryeuceda8590
@yuryeuceda8590 5 ай бұрын
@@sefiks Thanks friend for your quick answer
@humamalfariq1702
@humamalfariq1702 4 ай бұрын
Great i like it
@TechInstructorHub
@TechInstructorHub 5 ай бұрын
i am not able to get green box
@sefiks
@sefiks 5 ай бұрын
@@TechInstructorHub getting red or gray?
@TechInstructorHub
@TechInstructorHub 5 ай бұрын
@@sefiks just web is open but nothing display like no red and green box
@sefiks
@sefiks 5 ай бұрын
Seems your installation is problematic
@TechInstructorHub
@TechInstructorHub 5 ай бұрын
@@sefiks I have cross check my installation and also update the deepface but not working properly
@TechInstructorHub
@TechInstructorHub 5 ай бұрын
@@sefiks i am create a project. Face Attendance, in this project can i use the deepface in this project with the django framework. if i am performing i need to take deepface all source files code?
@tunateke9806
@tunateke9806 25 күн бұрын
Cool
Open Source Face Analysis with Python
15:07
Rob Mulla
Рет қаралды 57 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Face recognition + liveness detection: Face attendance system
29:33
Computer vision engineer
Рет қаралды 137 М.
Face recognition in real-time | with Opencv and Python
28:19
Pysource
Рет қаралды 302 М.
Diy a simple spot welding at home with capacitors just with 2$
13:47
Why I Switched from Skilled Worker Visa to Global Talent Visa in the UK
3:28
Sefik Ilkin Serengil
Рет қаралды 1,6 М.
Face Liveness Detection In Face Recognition
47:48
Prabhat Ale
Рет қаралды 28 М.