Comments (10)
1- store registration pictures in a folder (e.g. c:\users\dan\desktop\db).
Suppose that db folder has 3 identities: 1.jpg, 2.jpg, 3.jpg
2- when an user comes your system, take his/her current photo. Suppose that the current photo is tmp.jpg
3- build a for loop with the number of identities in your db folder. Call DeepFace for each photo in your db.
for i in range(0, 3):
obj = DeepFace.verify("tmp.jpg", "%s.jpg" % (str(i)))
if obj["verified"] == True:
print("This is identity", i)
break
I might add a find function to handle this operation in a simpler way.
from deepface.
Thanks for your quick reply. : D
Okay, I can loop it, so how much is it expensive for the CPU? Taking into account that the user does not want to wait too long.
Another question, taking advantage of the same context: is there a way to pre-train or pre-process (I don't know exactly the term) so that when making this loop I pass not the image, but a string?
For example, see this project https://github.com/ageitgey/face_recognition the images are nothing but an array of face information.
P.S .: I don't know exactly the terms because I'm trying to find a solution, I don't know if recognition is for authentication and identification, I'm lost.
from deepface.
Nope. all pre-process steps handled in the background of deepface.
The code block I previously shared builds a complex face recognition model in each iteration. This is costly. On the other hand, prediction is easy.
If you call deepface as illustrated below, then it will build a complex face recognition model once. This speeds your operations up dramatically.
obj = DeepFace.verify([
["tmp.jpg", "1.jpg"],
["tmp.jpg", "2.jpg"],
["tmp.jpg", "3.jpg"]
])
Then, obj variable is a list. You should check its verified and distance values.
from deepface.
Okay, I tried here.
I got the result:
{'pair_1': {'distance': 0.1356278657913208,
'max_threshold_to_verify': 0.4,
'model': 'VGG-Face',
'similarity_metric': 'cosine',
'verified': True}}
Which of these keys do I use to tell if it's the same person or not?
from deepface.
verified. If it is true, then the both images are same person.
from deepface.
Thank you for your time and congratulations on the project. I will test everything you showed me.
from deepface.
you're welcome. do not hesitate to ask questions if you have any problem.
PS: you can support this project by starring the repo :)
from deepface.
I star the project now :)
If your project fits mine, I'll pay you a lot of beers haha Hugs
from deepface.
As I mentioned, I can modify the framework based on the requirements. Inform me if you need anything.
from deepface.
I have the same question above, I'm building an attendance system but it takes an intensive amount of time for matching each image with the images in my dataset. Is there a way where I can speed up the process? maybe by saving the images as numpy and pass it to verify?
Thank you
from deepface.
Related Issues (20)
- [BUG]: Too many false positives HOT 2
- Input normalization overview HOT 4
- [FEATURE]: Refactor Filesystem Operations to Use pathlib Instead of os.path HOT 5
- [BUG]: Error: Input image must not have non-english characters HOT 6
- [BUG]: facial area coordinates are negative if a face is in the corner HOT 1
- [BUG]: Face detection does not work with: anti_spoofing = True HOT 7
- [BUG]: <list indices must be integers or slices, not str> HOT 18
- [BUG]: rounding numpy float issue
- [BUG]: <short description of the issue> HOT 6
- [BUG]: broken weight files
- [FEATURE]: Improve represent performance HOT 2
- I get CERTIFICATE_VERIFY_FAILED when the library tries to download the models weights
- [FEATURE]: support pipx install on Ubuntu 24.04, fails with "ValueError: You have tensorflow 2.17.0 and this requires tf-keras package. Please run `pip install tf-keras` or downgrade your tensorflow" HOT 1
- [BUG]: py.typed is missing
- [BUG]: GPU is not actually utilized HOT 8
- [BUG]: ValueError: The layer sequential has never been called and thus has no defined input. HOT 9
- [FEATURE]: Add an optional flag to the "find" function in recognition.py to return an ndarray. HOT 3
- [FEATURE]: add support for batch size and improve utilization of GPU to maximum HOT 2
- [FEATURE]: Comprehensive list of model URLs HOT 3
- [FEATURE]: New feature integration in api HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepface.