waylee001/FaceQualityCNN
作者 waylee001 | 下载 0 | 点赞 2 | 更新 2024-10-21
这个仓库里有什么
- 1 个 ONNX 模型(.onnx 文件)
- 3 个文件,其中 .md 1 个、.onnx 1 个
- 最近更新:2024-10-21
ONNX 文件清单
| 文件 | 大小 | 下载 |
|---|---|---|
| face-quality-cnn.onnx | — | 下载 |
怎么用
这些 ONNX 文件可以直接用 ONNX Runtime 加载运行;想先看网络结构,可以把文件上传到 Netron 在线查看器 查看。下载链接指向 Hugging Face 原始文件。
说明文档
Face Quality CNN
This model is capable of evaluating the quality of human faces in input images.
Inference
It takes aligned face images (112x112) as input and returns a quality score for the face (ranging from 0 to 1, with higher scores indicating higher quality).
Code
class face_quality_assessment():
def __init__(self, path):
# Initialize model
self.net = cv2.dnn.readNet(path)
self.input_height = 112
self.input_width = 112
def classify(self, srcimg):
input_img = cv2.resize(cv2.cvtColor(srcimg, cv2.COLOR_BGR2RGB), (self.input_width, self.input_height))
input_img = (input_img.astype(np.float32) / 255.0 - 0.5) / 0.5
blob = cv2.dnn.blobFromImage(input_img.astype(np.float32))
self.net.setInput(blob)
outputs = self.net.forward(self.net.getUnconnectedOutLayersNames())
return outputs[0].reshape(-1)
fqa = face_quality_assessment("weights/face-quality-assessment.onnx")
fqa_probs = fqa.classify(img)
license: apache-2.0
文件 (3)
.gitattributes
README.md
face-quality-cnn.onnx
ONNX
相关模型
同作者的其他模型
该作者暂无可展示的其他模型。
同类任务
该模型没有标注任务类型。