config.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:MMM-Facial-Recognition-Tools 作者: paviro 项目源码 文件源码
def model(algorithm, thresh):
    # set the choosen algorithm
    model = None
    if is_cv3():
        # OpenCV version renamed the face module
        if algorithm == 1:
            model = cv2.face.createLBPHFaceRecognizer(threshold=thresh)
        elif algorithm == 2:
            model = cv2.face.createFisherFaceRecognizer(threshold=thresh)
        elif algorithm == 3:
            model = cv2.face.createEigenFaceRecognizer(threshold=thresh)
        else:
            print("WARNING: face algorithm must be in the range 1-3")
            os._exit(1)
    else:
        if algorithm == 1:
            model = cv2.createLBPHFaceRecognizer(threshold=thresh)
        elif algorithm == 2:
            model = cv2.createFisherFaceRecognizer(threshold=thresh)
        elif algorithm == 3:
            model = cv2.createEigenFaceRecognizer(threshold=thresh)
        else:
            print("WARNING: face algorithm must be in the range 1-3")
            os._exit(1)
    return model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号