User Manual
Print

Face Comparison Using Similarity Confidence

Face Verification Result get face similarity confidence

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>photo</variable><variable>faceDetectionResult</variable><variable>photo1</variable><variable>photo2</variable><variable>faceDetectionResult1</variable><variable>faceDetectionResult2</variable><variable>faceVerificationResult</variable></variables><block type=\"UnaAI_FaceVerificationResult_getSimilarityConfidence\" disabled=\"true\" x=\"158\" y=\"337\"><value name=\"faceVerificationResult\"><block type=\"variables_get\" disabled=\"true\"><field name=\"VAR\">faceVerificationResult</field></block></value></block></xml>"}
				
			

This is used for getting two faces similarity confidence.

Parameters: AI Result (Face Detection from Azure)

Output: AI Result
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>photo1</variable><variable>photo2</variable><variable>faceDetectionResult1</variable><variable>faceDetectionResult2</variable><variable>faceVerificationResult</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\">photo1</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"Resources_getPhotoByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://www.magicubedu.com/una/AI5/samples/man1.jpg</field></shadow></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">photo2</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"Resources_getPhotoByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://www.magicubedu.com/una/AI5/samples/man2.jpg</field></shadow></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">faceDetectionResult1</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"UnaAI_detectFaces\"><value name=\"img\"><block type=\"variables_get\"><field name=\"VAR\">photo1</field></block></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">faceDetectionResult2</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"UnaAI_detectFaces\"><value name=\"img\"><block type=\"variables_get\"><field name=\"VAR\">photo2</field></block></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">faceVerificationResult</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"UnaAI_verifyFaces\"><value name=\"face1\"><block type=\"variables_get\"><field name=\"VAR\">faceDetectionResult1</field></block></value><value name=\"face2\"><block type=\"variables_get\"><field name=\"VAR\">faceDetectionResult2</field></block></value></block></value><next><block type=\"UnaAI_FaceDetectionResult_markFaces\"><field name=\"attribute\">FaceAttribute.Age</field><value name=\"faceDetectionResult\"><block type=\"variables_get\"><field name=\"VAR\">faceDetectionResult1</field></block></value><next><block type=\"UnaAI_FaceDetectionResult_markFaces\"><field name=\"attribute\">FaceAttribute.Age</field><value name=\"faceDetectionResult\"><block type=\"variables_get\"><field name=\"VAR\">faceDetectionResult2</field></block></value><next><block type=\"basic_consoleLogNum\"><value name=\"num\"><block type=\"UnaAI_FaceVerificationResult_getSimilarityConfidence\"><value name=\"faceVerificationResult\"><block type=\"variables_get\"><field name=\"VAR\">faceVerificationResult</field></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>"}
				
			

The output:

Face Verification Result Get Face Similarity Confidence - Output