Opencv-Face-Recognition | An android app for Face Recognition using OpenCV | Computer Vision library
kandi X-RAY | Opencv-Face-Recognition Summary
kandi X-RAY | Opencv-Face-Recognition Summary
This is an Android application for Face Detection using the OPENCV API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Called when a surface is changed
- Set preview
- Sets up camera parameters
- Process processing
- Get the height of the view
- Get the frame width
- Resume camera
- Open camera to preview
- Get the front - facing camera ID
- Called when a surface holder is destroyed
- Release the camera s camera
- Called when the surface is created
- Initializes the instance
- Called when the preview is stopped
- Called when the preview is started
- Called when the view is released
- Computes a bitmap from the input image
- Save the image
- Initializes the activity manager
Opencv-Face-Recognition Key Features
Opencv-Face-Recognition Examples and Code Snippets
Community Discussions
Trending Discussions on Opencv-Face-Recognition
QUESTION
I have a project where I need to include face recognition
in it. I am referring to this article. This article is using open-face
to get the face embeddings
and its saving all the embeddings in a pickle file. Then its passing the face embeddings data to support vector machine
which generates another pickle file. This file is later used to recognize and predict the face.
This has been working and is giving me more than 80% accuracy. But this article has not explained on how to calculate euclidean distance
. This I needed for my own research work.
I can easily calculate euclidean distance
between the face embedding of test image and face embeddings present in pickle file but I am not able to understand how to set the threshold value so that any distance more than that will be tagged as unknown
.
Can anyone please point me to some article where this has been explained and I can follow up from there. I have tried searching many articles but didnt get much results on this. Please help. Thanks
...ANSWER
Answered 2020-Apr-15 at 15:45You can build 2 ( normal ) distributions.
- distances between same person's faces
- distances between different faces
Intersection of these distributuins will be the threshold.
QUESTION
from sklearn.preprocessing import LabelEncoder
from sklearn.svm import SVC
import argparse
import pickle
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-e", "--embeddings",default=r"C:\Users\osama\Desktop\opencv-face-recognition\face_detection_model\output",
help="path to serialized db of facial embeddings")
ap.add_argument("-r", "--recognizer", default=r"C:\Users\osama\Desktop\opencv-face-recognition\face_detection_model\output",
help="path to output model trained to recognize faces")
ap.add_argument("-l", "--le", default=r"C:\Users\osama\Desktop\opencv-face-recognition\face_detection_model\output",
help="path to output label encoder")
args = vars(ap.parse_args())
# load the face embeddings
print("[INFO] loading face embeddings...")
data = pickle.loads(open(args["embeddings"], "rb").read())
# encode the labels
print("[INFO] encoding labels...")
le = LabelEncoder()
labels = le.fit_transform(data["names"])
# train the model used to accept the 128-d embeddings of the face and
# then produce the actual face recognition
print("[INFO] training model...")
recognizer = SVC(C=1.0, kernel="linear", probability=True)
recognizer.fit(data["embeddings"], labels)
# write the actual face recognition model to disk
f = open(args["recognizer"], "wb")
f.write(pickle.dumps(recognizer))
f.close()
#write the label encoder to disk
f = open(args["le"], "wb")
f.write(pickle.dumps(le))
f.close()
...ANSWER
Answered 2020-Jan-04 at 17:47You are unpickling an object here:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Opencv-Face-Recognition
You can use Opencv-Face-Recognition like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Opencv-Face-Recognition component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page