static void Main(string[] args) { String photo1 = "http://static.findface.pro/sample.jpg"; String photo2 = "http://static.findface.pro/sample2.jpg"; /* XXX Modify Host and Key here XXX */ FindFace.FindFaceAPI api = new FindFace.FindFaceAPI("http://172.16.9.2:8000", "GAFDHGIAGIHKGAAD"); try { FindFace.Identify.Results identifyResults = api.identify(photo1); printIdentifyResults(identifyResults); Console.WriteLine(""); FindFace.Detect.Results detectResults = api.detect(photo1); printDetectResults(detectResults); Console.WriteLine(""); FindFace.Verify.Response verifyResponse = api.verify(photo1, photo2); printVerifyResponse(verifyResponse); Console.WriteLine(""); } catch (Exception e) { Console.WriteLine("ERROR: {0}", e); } Console.WriteLine("Press any key to exit..."); Console.ReadKey(); }
static void printIdentifyResults(FindFace.Identify.Results r) { Console.WriteLine("+++ Identify Results:"); foreach (string box in r.Keys) { Console.WriteLine(" Box {0}", box); foreach (FindFace.Identify.BoxResult br in r[box]) { Console.WriteLine(" Confidence: {0}", br.confidence); Console.WriteLine(" Face.meta: {0}", br.face.meta); Console.WriteLine(" Face.timestamp: {0}", br.face.timestamp.ToString("dd MMM yyyy, HH:MM:ss")); Console.WriteLine(" Face.photo_hash: {0}", br.face.photo_hash); Console.WriteLine(" ..."); } } Console.WriteLine("--- End of Identify Results"); }