我有這個代碼。但是我無法將其作為函式運行。
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'
任何人都可以幫忙嗎?
uj5u.com熱心網友回復:
if verify_result_same.is_identical() & verify_result_same.is_confident() < 0.5:
在這里,您使用了與您在上一行中定義的函式相同的“verify_result_same”物件。
uj5u.com熱心網友回復:
verify_result_same是一個函式,您可能已經定義了一個名為verify_result_same. 因此,您應該將您的函式名稱從verify_result_same其他名稱重命名 。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/409639.html
標籤:
