Things used in this project

Hardware components:
DFRobot LattePanda
Software apps and online services:
Microsoft Cognitive Services


Code ExampleC#
Don't forget to replace the API key!
using System;
using System.IO;
using System.Net.Http.Headers;
using System.Net.Http;

namespace CSHttpClientSample
    static class Program
        static void Main()
            Console.Write("Enter the location of your picture:");
            string imageFilePath = Console.ReadLine();


            Console.WriteLine("\n\n\nWait for the result below, then hit ENTER to exit...\n\n\n");

        static byte[] GetImageAsByteArray(string imageFilePath)
            FileStream fileStream = new FileStream(imageFilePath, FileMode.Open, FileAccess.Read);
            BinaryReader binaryReader = new BinaryReader(fileStream);
            return binaryReader.ReadBytes((int)fileStream.Length);

        static async void MakeAnalysisRequest(string imageFilePath)
            var client = new HttpClient();

            // Request headers - replace this example key with your valid key.
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "Enter your apikey here");

            // Request parameters and URI string.
            string queryString = "returnFaceId=true&returnFaceLandmarks=false&returnFaceAttributes=age,gender";
            string uri = "" + queryString;

            HttpResponseMessage response;
            string responseContent;

            // Request body. Try this sample with a locally stored JPEG image.
            byte[] byteData = GetImageAsByteArray(imageFilePath);

            using (var content = new ByteArrayContent(byteData))
                // This example uses content type "application/octet-stream".
                // The other content types you can use are "application/json" and "multipart/form-data".
                content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
                response = await client.PostAsync(uri, content);
                responseContent = response.Content.ReadAsStringAsync().Result;

            //A peak at the JSON response.


13245269 10153668742428652 5499237831655557257 n
Matt Jani

tech head, tinkerer, robo-wrangler



Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback


Similar projects you might like

MPU6050 accelerometer on Windows 10 Raspberry 2
  • 78
  • 1


Using MPU6050 accelerometer data on Windows 10 Raspberry 2 to control model's roll and pitch with DirectX12XTK and ImGui

Forgot Something: The Calliope-Remembrall will Remind You
  • 253
  • 2

Work in progress

This is an utterly useless project since this magical object is quite useless. Everybody forgets stuff, naturally.

Break Your Heart - IoT Project - Blinky - 2 LEDs
  • 239
  • 3

Full instructions

The Blinky project with two LEDs.

Break your heart - IoT Project - IoT Blocky
  • 708
  • 4


Use this project to control the LEDs on the Raspberry Pi Sense HAT.

Windows Remote Arduino (Windows Remote Arduino Experience)
  • 78
  • 0


Break your heart - The Windows Remote Arduino Experience allows you to blinking LEDs on the Arduino

Add projectSign up / Login