繁体   English   中英

我不知道我的 function 出了什么问题

[英]I do not know what is wrong with my function

我有这个代码。 但是我无法将它作为 function 运行。

def verify_result_same():
    if verify_result_same.is_identical() & verify_result_same.confidence() > 0.5:
            face_client.face.verify_face_to_face(source_image1_id, detected_faces_ids[0])
            print('Faces from {} & {} are of the same person, with confidence: {}'
            .format(source_image_file_name1, target_image_file_names[0], verify_result_same.confidence))
            print("Valid face verification")

    else: 
            print('Faces from {} & {} are of a different person, with confidence: {}'
            .format(source_image_file_name1, target_image_file_names[0], verify_result_same.confidence))
            print("Invalid face verification")
            text = "Face verification is not valid. Please try again."
            send_msg(text)

我收到错误,例如:

AttributeError: 'function' object has no attribute 'is_identical'
AttributeError: 'function' object has no attribute 'confidence'

任何人都可以帮忙吗?

if verify_result_same.is_identical() & verify_result_same.is_confident() < 0.5:

在这里,您使用了“verify_result_same” object,它与您在上一行中定义的 function 相同。

verify_result_same是一个 function,您可能已经定义了一个名为 verify_result_same 的verify_result_same 因此,您应该将 function 名称从verify_result_same重命名为其他名称。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM