# Face Embeddings using Deepface
*Author: Krishna katyal*
< br / >
## Description
The pipeline is used to extract the feature vector of detected faces in images. It uses the for face embeddings [`Deepface` ](https://github.com/serengil/deepface ).
< br / >
## Code Example
Load an image from path './test_face.jpg'.
*Write the pipeline in simplified style* :
```python
import towhee
towhee.glob('./test_face.jpg') \
.image_decode.cv2() \
.face_embedding.deepface(model_name = 'DeepFace').to_list()
```
< img src = "./image.png" height = "200px" / >
*Write a pipeline with explicit inputs/outputs name specifications:*
```python
import towhee
towhee.glob['path']('./test_face.jpg') \
.image_decode.cv2['path', 'img']() \
.face_embedding.deepface['img', 'vec'](model_name = 'DeepFace') \
.select['img','vec']() \
.show()
```
< br / >
## 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
< br / >
## 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.
< br / >
**Reference**
https://github.com/serengil/deepface
You can refer to [Getting Started with Towhee ](https://towhee.io/ ) for more details. If you have any questions, you can [submit an issue to the towhee repository ](https://github.com/towhee-io/towhee/issues ).