Comments (16)
Also when running the simple example, how can we print out the confidence of match?
from face_recognition.
Question 1 : compare_faces is just a wrapper that call face_distance and applies a threshold. You can add an extra parameter to it to specify the threshold. For instance, for a value of 0.8 :
results = face_recognition.compare_faces([my_face_encoding], unknown_face_encoding,0.8)
Question 2 : If you need to see the confidence value, use the function face_distance directly : it will return a list of distances between the list of candidate faces and the target face.
from face_recognition.
seems when i run basic example, i get an error about dlib. any thoughts on how to fix? i'm pretty sure i have it installed already:
import dlib
ImportError: No module named dlib
from face_recognition.
If you can't import dlib, then it's not installed (at least not for the version of Python you are running).
from face_recognition.
can your example be called on command line? Eg, for the basic example you gave, I would just run the below:
face_recognition known/ unknownpng/
How can I run it with compare_faces on command line?
from face_recognition.
Ah, good question. Unfortunately the command line application doesn't currently report confidence values. That's something I could add in the future, though.
from face_recognition.
so essentially I have to run your example as a script? something like below?
from PIL import Image
import face_recognition
results = face_recognition.compare_faces("Directory/known", "Directory/unknownjpg",0.8)
It seems not to like my input. Are [my_face_encoding], unknown_face_encoding meant to be directories or something else?
from face_recognition.
I think the confusion is that your original question was about the command-line application but the answer @sbourigault gave you was the answer if you are writing code using the python library instead. Those are two different things.
Unfortunately the command-line application doesn't currently return confidence values like you want. That's a new feature that would have to be added.
If you are familiar with Python coding and want to write your own script that acts like the command line application but returns those values, you could do that. But if you aren't, it might be easier to just wait until I have a chance to add that feature to the command-line application.
To answer your other question, the parameters to that function are not meant to be directories. The parameters expected by each function are listed in the API docs. There's also a minimal code example here that shows how it works.
from face_recognition.
ok got it. Think I have things working now!
from face_recognition.
Awesome! Glad it's working.
from face_recognition.
Why do you recommend a threshold distance of point 6? Is that in literature somewhere? If so, where? Point 6 isn't a lot? It is 0 to 1 right?
from face_recognition.
0.6 is what was most accurate with the training data set according to Davis King. See his post at http://blog.dlib.net/2017/02/high-quality-face-recognition-with-deep.html
from face_recognition.
"The network training started with randomly initialized weights and used a structured metric loss that tries to project all the identities into non-overlapping balls of radius 0.6. " So this means that lowering this to like point 2 or point 3 isn't going to give better results? Essentially he's somehow mapped things to point 6 if good fit? I'll have to read more papers later.
Separately, I also wish this code could sort the top matches. I ran it across a video and it returns sometimes several examples. It would be helpful to sort by confidence/distance and rank the results. But I don't think results are ranked in anyway.
from face_recognition.
If instead of calling face_recognition.compare_faces()
, you instead call face_recognition.face_distance()
, that will return the distance between each possible match and the image you are testing. Then you could call scipy.stats.rankdata()
to turn that into a ranked list (assuming you have scipy installed).
from face_recognition.
@ageitgey Does this work well on any ethnicity? I'm trying to do some benchmarking on asian and chinese faces. I'm wondering how it will perform. Any idea if it will break down? My preliminary results on South American faces show several matches---I'm trying to reduce with confidence and understand, etc.
from face_recognition.
@ageitgey Also, when you run the program, normally from command line, it does return matches with distance greater than .6. I know this, b/c when I take the matches and compare them separately with the distance program, to try to help rank them and understand, it shows the distance and for some matches they’re greater than point6, even though threshold was that. How is this possible?
from face_recognition.
Related Issues (20)
- image_recognition: Error while calling cudaGetDevice
- Import Error: libjpeg.so.62: version `LIBJPEGTURBO_6.2' not found HOT 1
- "Invalid image path: {}".format(X_img_path))
- [Question] - Using multiple angles of the face to generate a robust encoding to compare in videos
- It's not multi-thread due to Python GIL HOT 1
- foreign function interface (ffi)?
- Piping StdOut Sometimes Drops Output
- LFW Evaluation Example
- Design thinking
- 【BUG】Video example code is not working... HOT 2
- Jetson Nano 4GB: Segmentation fault (core dumped) - dlib and face_recognition HOT 1
- Doesn't works with ffmpeg 6.0_1
- Doesn't works
- Not working HOT 3
- Not accurate HOT 1
- Problem "ValueError: operands could not be broadcast together with shapes ( , ) (128, )" Solution
- fcaial recognition wrong person
- I want to detect whether the faces in the pictures are complete HOT 1
- Face similiarity for multiple images
- Fr
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 face_recognition.