copied
Readme
Files and versions
1.7 KiB
MobileFaceNet Face Landmark Detecter
authors: David Wang
Desription
MobileFaceNets is a class of extremely efficient CNN models to extract 68 landmarks from a facial image, which use less than 1 million parameters and are specifically tailored for high-accuracy real-time face verification on mobile and embedded devices. This repo is an adaptation from cuijian/pytorch_face_landmark.
Code Example
Extract facial landmarks from './img1.jpg'.
Write the pipeline in simplified style:
import towhee
towhee.glob('./img1.jpg') \
.image_decode.cv2() \
.face_landmark_detection.mobilefacenet() \
.select('img','landmark') \
.to_list()
Write a same pipeline with explicit inputs/outputs name specifications:
import towhee
towhee.glob['path']('./img1.jpg') \
.image_decode.cv2['path', 'img']() \
.face_landmark_detection.mobilefacenet['img', 'landmark']() \
.select('img','landmark') \
.show()

Factory Constructor
Create the operator via the following factory method
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.
Parameters:
img: towhee.types.Image (a sub-class of numpy.ndarray)
The input image.
Returns: numpy.ndarray
The extracted facial landmarks.
1.7 KiB
MobileFaceNet Face Landmark Detecter
authors: David Wang
Desription
MobileFaceNets is a class of extremely efficient CNN models to extract 68 landmarks from a facial image, which use less than 1 million parameters and are specifically tailored for high-accuracy real-time face verification on mobile and embedded devices. This repo is an adaptation from cuijian/pytorch_face_landmark.
Code Example
Extract facial landmarks from './img1.jpg'.
Write the pipeline in simplified style:
import towhee
towhee.glob('./img1.jpg') \
.image_decode.cv2() \
.face_landmark_detection.mobilefacenet() \
.select('img','landmark') \
.to_list()
Write a same pipeline with explicit inputs/outputs name specifications:
import towhee
towhee.glob['path']('./img1.jpg') \
.image_decode.cv2['path', 'img']() \
.face_landmark_detection.mobilefacenet['img', 'landmark']() \
.select('img','landmark') \
.show()

Factory Constructor
Create the operator via the following factory method
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.
Parameters:
img: towhee.types.Image (a sub-class of numpy.ndarray)
The input image.
Returns: numpy.ndarray
The extracted facial landmarks.