End-to-end face detection, cropping, norm estimation, and landmark detection in a single onnx model, model.onnx
.
You can try this model at the following link. Thanks for hysts.
See src.
import onnxruntime as ort
import cv2
sess = ort.InferenceSession("model.onnx")
img = cv2.imread("input.jpg")
scores, bboxes, keypoints, aligned_imgs, landmarks, affine_matrices = sess.run(None, {"input": img})
# float32 int64 int64 uint8 int64 float32
# (N,) (N, 4) (N, 5, 2) (N, 224, 224, 3) (N, 106, 2) (N, 2, 3)
This model requires onnxruntime>=1.11
.
This is simply a merged model of the following underlying models with some pre- and post-processing.
model | reference | |
---|---|---|
face detection | SCRFD_10G_KPS | https://github.com/deepinsight/insightface/tree/master/detection/scrfd#pretrained-models |
landmark detection | 2d106det | https://github.com/deepinsight/insightface/blob/master/alignment/coordinate_reg/README.md#pretrained-models |
Implemented the following processing by PyTorch and exported to ONNX.
Input transform:
(Face Detection)
Post-processing of face detection
Norm estimation and face cropping
(Landmark Detection)
Perform post-processing for landmark detection.
Please check with the model provider regarding the license for your use.
This model includes the work that is distributed in the Apache License 2.0.