|
|
|
# Mobilefacenet Face Landmark Detecter
|
|
|
|
|
|
|
|
*authors: David Wang*
|
|
|
|
|
|
|
|
|
|
|
|
## Desription
|
|
|
|
|
|
|
|
A class of extremely efficient CNN models to extract 68 landmarks from a facial image[MobileFaceNets](https://arxiv.org/pdf/1804.07573.pdf).
|
|
|
|
|
|
|
|
## Code Example
|
|
|
|
|
|
|
|
extracted facial landmark from './img1.jpg'.
|
|
|
|
|
|
|
|
*Write the pipeline in simplified style*:
|
|
|
|
|
|
|
|
```python
|
|
|
|
from towhee import dc
|
|
|
|
|
|
|
|
dc.glob('./img1.jpg') \
|
|
|
|
.face_landmark_detection.mobilefacenet() \
|
|
|
|
.to_list()
|
|
|
|
```
|
|
|
|
|
|
|
|
*Write a same pipeline with explicit inputs/outputs name specifications:*
|
|
|
|
|
|
|
|
```python
|
|
|
|
from towhee import dc
|
|
|
|
|
|
|
|
dc.glob['path']('./img1.jpg') \
|
|
|
|
.image_decode.cv2['path', 'img']() \
|
|
|
|
.face_landmark_detection.mobilefacenet() \
|
|
|
|
.to_list()
|
|
|
|
```
|
|
|
|
|
|
|
|
## Factory Constructor
|
|
|
|
|
|
|
|
Create the operator via the following factory method
|
|
|
|
|
|
|
|
***ops.face_landmark_detection.mobilefacenet(pretrained = True)***
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
***pretrained***
|
|
|
|
|
|
|
|
whether load the pretrained weights..
|
|
|
|
|
|
|
|
supported types: `bool`, default is True, using pretrained weights
|
|
|
|
|
|
|
|
## Interface
|
|
|
|
|
|
|
|
An image embedding operator takes an image as input. it extracts the embedding back to ndarray.
|
|
|
|
|
|
|
|
**Args:**
|
|
|
|
|
|
|
|
***pretrained***
|
|
|
|
|
|
|
|
whether load the pretrained weights..
|
|
|
|
|
|
|
|
supported types: `bool`, default is True, using pretrained weights
|
|
|
|
|
|
|
|
|
|
|
|
**Parameters:**
|
|
|
|
|
|
|
|
***image***: *np.ndarray*
|
|
|
|
|
|
|
|
The input image.
|
|
|
|
|
|
|
|
|
|
|
|
**Returns:**: *numpy.ndarray*
|
|
|
|
|
|
|
|
The extracted facial landmark.
|
|
|
|
|