コード例 #1
0
        static void Main()
        {
            Spacer sp     = new Spacer('*');
            Header header = new Header(">>> NEW HEADER CLASS <<<");

            // Get the path and filename to process from the user.
            header.DisplayHeader();
            Console.Write(
                "Enter the path to an image with faces that you wish to analyze: ");
            string imageFilePath = @"C:\Users\Administrator\source\repos\JARVIS2\CSC438\faces\faceCollection.json"; //Console.ReadLine();

            Console.Write(imageFilePath);                                                                           // DEBUG: skipping user input for now

            // DEBUG: Testing aux projects
            Console.WriteLine();
            sp.ShowSpacer('=');
            Console.WriteLine();

            Console.WriteLine("> Press any key to continue.");
            Console.ReadKey();
            XDebug xd = new XDebug();

            xd.ShowCheck();

            FileHandler     fh = new FileHandler();
            FaceDataDisplay fd = new FaceDataDisplay();

            fd.DisplayFaceData();

            string      fileText = fh.GetFile(imageFilePath);
            List <Face> faceList = JsonConvert.DeserializeObject <List <Face> >(fileText);

            Console.WriteLine("\n>>> First faceID in faceList: {0}", faceList[0].faceId);

            #region REST API Call
            //if (File.Exists(imageFilePath))
            //{
            //    // Execute the REST API call.
            //    try
            //    {
            //        Console.WriteLine("\nPlease wait a moment for the results to appear.\n");
            //        MakeAnalysisRequest(imageFilePath);
            //    }
            //    catch (Exception e)
            //    {
            //        Console.WriteLine("\n" + e.Message + "\nPress Enter to exit...\n");
            //    }
            //}
            //else
            //{
            //    Console.WriteLine("\nInvalid file path.\nPress Enter to exit...\n");
            //}
            Console.ReadLine();
            #endregion
        }