Git Product home page Git Product logo

Comments (10)

serengil avatar serengil commented on September 18, 2024

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.

dan-developer avatar dan-developer commented on September 18, 2024

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.

serengil avatar serengil commented on September 18, 2024

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.

dan-developer avatar dan-developer commented on September 18, 2024

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.

serengil avatar serengil commented on September 18, 2024

verified. If it is true, then the both images are same person.

from deepface.

dan-developer avatar dan-developer commented on September 18, 2024

Thank you for your time and congratulations on the project. I will test everything you showed me.

from deepface.

serengil avatar serengil commented on September 18, 2024

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.

dan-developer avatar dan-developer commented on September 18, 2024

I star the project now :)

If your project fits mine, I'll pay you a lot of beers haha Hugs

from deepface.

serengil avatar serengil commented on September 18, 2024

As I mentioned, I can modify the framework based on the requirements. Inform me if you need anything.

from deepface.

malahmadi1 avatar malahmadi1 commented on September 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.