稳定调用及效果更好的API,详见视觉开放智能平台:人脸属性识别、表情识别。
FQA人脸质量评估模型
FQA模型包含3个方面的创新, rank映射, Ordinal Regression和multi-labelloss:
本模型可以评估输入图片中人脸的质量
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.outputs import OutputKeys
import numpy as np
face_quality_assessment_func = pipeline(Tasks.face_quality_assessment, 'damo/cv_manual_face-quality-assessment_fqa')
img = 'https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/face_recognition_1.png'
face_quality_score = face_quality_assessment_func(img)[OutputKeys.SCORES]
print(f'Face quality score={face_quality_score}')
本模型及代码来自达摩院自研技术