Skip to main content

face recognition library, flexible and easy to use

Project description

FaceF

A library for face recognition, flexible and easy to use. The library uses a lot of models like ssd, mtcnn, facenet .... These models will be downloaded automatically when used for the first time, please make sure your network connection is not blocked to google drive.

Install

FaceF is available on pypi.org, if you just want to use it for your project, install it using pip. Requires python>=3.6, tensorflow2

pip install facef

To use

1. Face detection

import cv2
from facef.detection import ssd_detect, mtcnn_detect 

img = cv2.imread('path_to_image.jpg')

boxes = ssd_detect(img)
# boxes,_ = mtcnn_detect(img)
for box in boxes:
    cv2.rectangle(img), (box[0],box[1]), (box[2],box[3]), (0,255,0),thickness=2)
cv2.imshow('image', img)

2. Face extract feature use Facenet

import cv2
from facef.extraction import facenet_ext 

img_face = cv2.imread('face_image.jpg')

emb = facenet_ext(face_img)
print(emb)

3. Get face distance

import cv2
from facef.distance import face2face_distance 

distance = face2face_distance(emb_face1, emb_face2)
print(distance)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facef-0.1.4.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

facef-0.1.4-py3-none-any.whl (13.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page