This library is truly amazing, but I am facing a situation that is challenging me. When working with a phone or computer camera, DeepFace is impeccable and very accurate, but when I use security cameras, the model loses a lot of accuracy. I am using ArcFace and RetinaFace, but the more I add images of people's faces, the more it gets confused (it keeps switching between IDs, all with very low distances, which indicates it is almost certain of the response). Did I miss something? Is there any preprocessing that should be done when building the dataset before creating the model? Or is DeepFace not recommended for security cameras? Any suggestions or help would be greatly appreciated.
@sefiks24 күн бұрын
TBH, i didn't test it with security cameras, maybe one would make a comment here
@cafeecomputacao23 күн бұрын
@@sefiks Alright.. do you think it's a good idea to retrain the ArcFace model with images from security cameras?
@sefiks23 күн бұрын
@ training requires running experiments with many gpus for days. If you can afford, why not.
@cafeecomputacao23 күн бұрын
@@sefiks i will try 🤓
@AshishUncw10 ай бұрын
@serengil, I need some help on this code. For the Face Recognition part, is the ArcFace Model trained with weights? and, How can i change the threshold value at the output? Please help me with this.
@sefiks10 ай бұрын
arcface model comes with pre-trained weights. verify function returns distance. check this distance value with your tuned threshold instead of verified key.
@tunateke98063 жыл бұрын
Its performance in the wild is really amazing!
@shachoud3 жыл бұрын
detect face in my case taking approximately 20 to 30 sec, what did u do to get good performance? Please reply
@ujjwaltyagi81452 жыл бұрын
Thanks Sefik for this amazing tutorial. I was trying to extract and save these faces detected by RetinaFaces as separate image files and I succeeded in doing so. But I later tried feeding the path of these saved extracted faces to deepface.verify() but it says that these images of extracted faces do not have a face. Can you suggest what to do?
@sefiks2 жыл бұрын
if you already extracted faces with retinaface, deepface should not extract faces from those pre-processed images. Use skip option for detector backend. DeepFace.verify("img.jpg", detector_backend="skip")
@ujjwaltyagi81452 жыл бұрын
@@sefiks I'll give it a try and comment the status. Thank you so much for your response.
@AshishUncw9 ай бұрын
@Serengil , Is the threshold value fixed in the code? When I justvtry to change it and run, I still see the same value. Can you please help me out with it?
@sefiks9 ай бұрын
yes, threshold is set from the code here: github.com/serengil/deepface/blob/master/deepface/modules/verification.py#L356 if you want to use your own threshold, then get the distance key from the result of verify and compare with your own threshold.
@emreparlak27294 күн бұрын
hey all, i am getting the following error code on jupyter lab. can anyone help me with this? A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces `keras.layers` and `keras.operations`). You are likely doing something like: ... i get this error after doing faces = RetinaFace.detect_faces('example.jpg')
@sefiks4 күн бұрын
Downgrade your tf
@khoinguyenphamang7263 жыл бұрын
I've an issue with extract_face function, the pre-trained weigth model could not be loaded due to the limitation. I've downloaded the .h5 file manually from the url, however, i've no ideal of where and how to put it to make the code run (as it states that the directory should be '/root/.deepface/weights/retinaface.h5') . Could you please help me? Many thanks in advance
@sefiks3 жыл бұрын
you should store the pre-trained weights to HOME_FOLDER/.deepface/weights you can find out the home folder with the command "cd ~" in the terminal. E.g. mine is /Users/sefik in my mac.
@khoinguyenphamang7263 жыл бұрын
Thank you so much, but for colab users like me, what should be the HOME_FOLDER? I tried with Path.home and it indicates to /root, but i did not find any folder there. Have I mistaken that one?
@sefiks3 жыл бұрын
You should create /root/.deepface in this case manually
@IffatJahanTuli2 жыл бұрын
Hello Sefik! Thanks for the tutorial. Is it possible to detect/extract the whole head including ear using retinaface?
@sefiks2 жыл бұрын
Hello. Unfortunately, retinaface just returns 5 facial landmark point. However, you can do it via mediapipe: kzbin.info/www/bejne/rHaWen6Go9-nm80
@shachoud3 жыл бұрын
Dear Sefik, Thanks for your video.... It's really knowledgeable. I ran the same code and it is detecting the face correctly, just that extract face function taking approximately 20 to 30 sec to give response. Can you please guide what could have gone wrong ?
@sefiks3 жыл бұрын
Retinaface is very complex model. That is the reason why is it so successful. You cannot do anything to speed it up. I recommend you to use any other detector such as ssd or mtcnn if speed is important in your case.
@shachoud3 жыл бұрын
@@sefiks But in your video it works very fast... I just install the retina-face library and tried extract face function. When I ran first time, it downloaded the h5 file and started the execution. Is it all I need to do ? Another question is in extract function we have model as optional attribute, what are the values of that..?
@sefiks3 жыл бұрын
@@shachoud because I cut the waiting seconds in the video
@kamranhuseynov28972 жыл бұрын
@@shachoud retinaface is much faster model and it shouldnt take 20 seconds in any case. So, retinaface API might be slow, maybe it is loading the model everytime you use a function from Retinaface module, I would suggest writing and using retinaface model in tensorflow, not through a package.
@AlbertTLS2 жыл бұрын
After all faces are detected, how do you extract all the faces into a new image?
@sefiks2 жыл бұрын
Call extract faces function and transfer its output to opencv as input
@azgartar2 жыл бұрын
Hi Sefik, Thank you for the tutorial, very informative. However, Im using the M1 Mac with Miniforge in order to use Tensorflow, and I have 2.4. Is the a method using retina-face with Tensorflow 2.4. I am have lots of dependancy errors, and if I negate the dependancies, I get much more errors. I would appreciate any help
@sefiks2 жыл бұрын
Solution is mentioned here: github.com/serengil/deepface/issues/391
@eduardmart1237 Жыл бұрын
How to enable cuda?
@sefiks Жыл бұрын
Install tensorflow-gpu dependency first
@eduardmart1237 Жыл бұрын
@@sefiks what version should i use?
@jacobjohns78913 жыл бұрын
@Sefik Ilkin Serengil Is it work correctly for 200 to 300 employees of company for there Biometric attendance from realtime webcame?
@sefiks3 жыл бұрын
I guess so
@jacobjohns78913 жыл бұрын
@@sefiks Can it work for real time face recognition from webcam feed to recognize 300 employees of company?
@jacobjohns78913 жыл бұрын
@@sefiks Please reply me sir..!!
@sefiks3 жыл бұрын
@@jacobjohns7891 Yes, this is applicable.
@jacobjohns78913 жыл бұрын
@@sefiks Can I get your email or any contact info there we can talk a little about it?
@ButterNCreamz11 ай бұрын
Is there a formula for the confidence score? I need it for the documentation of my project.
@sefiks11 ай бұрын
No, unfortunately
@ButterNCreamz11 ай бұрын
@@sefiks how do you get the score? Is that from similarity?
@sefiks11 ай бұрын
@@ButterNCreamz it is distance. e.g. distance = 1 - similarity for cosine.
@towdammachittamma43123 жыл бұрын
Hi Serengil can you please make a video explaining the Video Face Recognition Demo of ArcFace
@sefiks3 жыл бұрын
Please watch this video: kzbin.info/www/bejne/Y5ScpIaAmN1pras . ArcFace is available in deepface stream function.
@asmitha309 Жыл бұрын
hey ,Sefik OSError: Unable to open file (truncated file: eof = 56376769, sblock->base_addr = 0, stored_eof = 118667368) I am getting this error ,how can i fix it? pls help me
@sefiks Жыл бұрын
Your tensorflow installation seems not okay
@quangtuyennguyen40812 жыл бұрын
sir, can you tell me what backbone the Retina face use? Mobilenet0.25 or Resnet50?
@sefiks2 жыл бұрын
it is not mentioned in the reference study I used: github.com/StanislasBertrand/RetinaFace-tf2
@alperen416 Жыл бұрын
@sefiks Selamlar. Her fotoğrafa 5 saniye ayırıyor. Bu süreyi azaltmanın bir yolu var mıdır ?
@sefiks Жыл бұрын
retinaface kompleks bir model. basaridan cok sure performansi sizin icin bir kisitsa kullanmanizi tavsiye etmem. ancak gpu kullanarak bu sureyi azaltabilirsiniz. opencv haarcascade kullanabilirsiniz. ancak retinaface'in basari performansina baska bir model erisememekte.
@alperen416 Жыл бұрын
@@sefiks teşekkürler elinize sağlık bu arada başarılı modül yapmışsınız gerçekten
@sefiks Жыл бұрын
Begendiyseniz lutfen repoyu yildizlayarak destek olun ☺️ videoyu da ayni sekilde.
@eduardmart1237 Жыл бұрын
Is it possible to use this model in batch mode, for better gpu performance?
@sefiks Жыл бұрын
What do you mean as batch mode
@eduardmart1237 Жыл бұрын
@@sefiks detecting several pictures at the same time.
@sefiks Жыл бұрын
@@eduardmart1237 no it can process one picture
@好吃的披薩3 жыл бұрын
Hello, I have a problem, my object detection box will run away, what is the problem
@sefiks3 жыл бұрын
What do you mean?
@phamtrunghieuk15hl62 жыл бұрын
I give a photo of the face of the person wearing the mask and the model does not detect the face. how can i fix it?
@sefiks2 жыл бұрын
You cannot, those models do not care people with masks
@Colin_chen3 жыл бұрын
thanks for your vedio. but i cant pip install deepface ,it will output error
@sefiks3 жыл бұрын
I need the error message to understand what is going on
@Colin_chen3 жыл бұрын
@@sefiks i sent ig message thanks
@brianlee9624 Жыл бұрын
Thanks Sefik!
@dhruvingandhi34762 жыл бұрын
how many FPS on using nvidia 1050 GPU?
@sefiks2 жыл бұрын
you have test it yourself. i have no idea.
@ThedarkNet123123 жыл бұрын
how much image size input
@sefiks3 жыл бұрын
You can pass any size image
@sanjeevikumar28968 ай бұрын
Hello fellows, im facing an error with recognition path, if you guys come across this error please help me with this ValueError: `padding` must be either `'VALID'` or `'same'`. Received valid.
@sefiks8 ай бұрын
Upgrade retina-face to latest
@sanjeevikumar28968 ай бұрын
Hi@@sefiks. i have a version of 0.0.17. but it still throws the same error. Im doing this project for my college official use. can i get your instagram id or any platform so that i can clear my doubts. Please
@sanjeevikumar28968 ай бұрын
@@sefiksraise ValueError( ValueError: The last dimension of the inputs to a Dense layer should be defined. Found None. Full input shape received: (None, None) i faced this as well
@sefiks8 ай бұрын
@@sanjeevikumar2896 try to downgrade tensorflow to 2.15
@DAFFIN693 жыл бұрын
which python version are you used on anaconda, sefik i have problem in deepface because tensrflow and keras need python 3.6 < 3.7 but i have 3.9.4 i try to install python 3.6 always error not solved please, maybe you can help me thanks
@sefiks3 жыл бұрын
Python 3.8.5, tensorflow 2.4.1
@dennisasamoah22133 жыл бұрын
incredible
@duyduy55956 ай бұрын
This is not useful, I thought you teach us how to make a dataset, train it then use the result to recognize faces
@sefiks6 ай бұрын
What makes you think that? You should read video title and description.