logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

3.5 KiB

Face Embeddings using Deepface

Author: Krishna katyal


Description

The pipeline is used to extract the feature vector of detected faces in images. It uses the for face embeddings Deepface.


Code Example

Load an image from path './test_face.jpg'.

Write a pipeline with explicit inputs/outputs name specifications:

from towhee import pipe, ops, DataCollection

p = (
    pipe.input('path')
        .map('path', 'img', ops.image_decode())
        .map('img', 'vec', ops.face_embedding.deepface(model_name = 'DeepFace'))
        .output('img', 'vec')
)

DataCollection(p('./test_face.jpg')).show()


Factory Constructor

Create the operator via the following factory method

face_embedding.deepface(model_name = 'which model to use')

Model options:

  • VGG-Face
  • FaceNet
  • OpenFace
  • DeepFace
  • ArcFace
  • Dlib
  • DeepID
  • Facenet512


Interface

A face embedding operator takes a face image as input. It extracts the embedding in ndarray.

Parameters:

img: towhee.types.Image (a sub-class of numpy.ndarray)

​ The input image.

Returns: numpy.ndarray

​ The extracted image embedding.


Reference

https://github.com/serengil/deepface

You can refer to Getting Started with Towhee for more details. If you have any questions, you can submit an issue to the towhee repository.

More Resources

3.5 KiB

Face Embeddings using Deepface

Author: Krishna katyal


Description

The pipeline is used to extract the feature vector of detected faces in images. It uses the for face embeddings Deepface.


Code Example

Load an image from path './test_face.jpg'.

Write a pipeline with explicit inputs/outputs name specifications:

from towhee import pipe, ops, DataCollection

p = (
    pipe.input('path')
        .map('path', 'img', ops.image_decode())
        .map('img', 'vec', ops.face_embedding.deepface(model_name = 'DeepFace'))
        .output('img', 'vec')
)

DataCollection(p('./test_face.jpg')).show()


Factory Constructor

Create the operator via the following factory method

face_embedding.deepface(model_name = 'which model to use')

Model options:

  • VGG-Face
  • FaceNet
  • OpenFace
  • DeepFace
  • ArcFace
  • Dlib
  • DeepID
  • Facenet512


Interface

A face embedding operator takes a face image as input. It extracts the embedding in ndarray.

Parameters:

img: towhee.types.Image (a sub-class of numpy.ndarray)

​ The input image.

Returns: numpy.ndarray

​ The extracted image embedding.


Reference

https://github.com/serengil/deepface

You can refer to Getting Started with Towhee for more details. If you have any questions, you can submit an issue to the towhee repository.

More Resources