{"id":52,"date":"2020-05-08T22:09:24","date_gmt":"2020-05-08T22:09:24","guid":{"rendered":"http:\/\/fadyanwar.com\/?p=52"},"modified":"2020-05-26T20:27:21","modified_gmt":"2020-05-26T20:27:21","slug":"an-aiot-example-using-raspberry-pi-and-azure-ai","status":"publish","type":"post","link":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/","title":{"rendered":"An AIoT Example using Raspberry Pi and Azure AI"},"content":{"rendered":"\n<p class=\"has-drop-cap\">AIoT is what you get when you combine AI with IoT, using it you can create very interesting applications, not just your average IoT device that collects telemetry data and uploads it to the cloud, but a device that can do smart things using cloud computing and AI services such as Azure AI. <\/p>\n\n\n\n<p>In this article I&#8217;m going to explain an example of AIoT using a Raspberry Pi, a <a href=\"https:\/\/www.raspberrypi.org\/products\/camera-module-v2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pi Camera<\/a> and Azure Face API. Raspberry Pi, if you are not already familiar with, is a credit card sized computer which have a huge ecosystem around it of extensions and software. One of the very popular extensions is the Pi Camera, a tiny camera that you can attach it to a Pi board and by doing so we can have so many potentials.<\/p>\n\n\n\n<p>This a howto article intended for the technical crowd who wishes to learn about AI and IoT applications, however if you are a non techie, you may enjoy some of my business minded articles on <a href=\"http:\/\/fadyanwar.com\/index.php\/2020\/05\/05\/picking-the-right-technology-for-a-post-pandemic-age\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to deal with these technologies<\/a>. Also, if you are interested in the technology you might wish to follow me as I&#8217;m going to demonstrate in the future articles how to become a citizen developer and develop your IoT applications without code involved. <\/p>\n\n\n\n<p>In this example I&#8217;m going to use a <a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.org\/\" target=\"_blank\">Raspberry PI<\/a>, Azure <a rel=\"noreferrer noopener\" href=\"https:\/\/azure.microsoft.com\/en-us\/services\/cognitive-services\/face\/\" target=\"_blank\">Face API<\/a> from their Cognitive Services and <a rel=\"noreferrer noopener\" href=\"https:\/\/nodejs.org\/en\/\" target=\"_blank\">nodejs <\/a>to write things up. You can actually achieve the same using any other programming language such as Python, C#, Go or <a rel=\"noreferrer noopener\" href=\"https:\/\/opensource.com\/article\/17\/3\/operate-relays-control-gpio-pins-raspberry-pi\" target=\"_blank\">even PHP<\/a> if you like, since all of these languages are being support by the nifty Pi. I&#8217;m using nodejs for its merit that you won&#8217;t need to parse json messages in order to to interact with REST services, so it would be more convenient than say Python.<\/p>\n\n\n\n<p>In order to follow through this article you will need first to <a rel=\"noreferrer noopener\" href=\"https:\/\/www.raspberrypi.org\/help\/noobs-setup\/2\/\" target=\"_blank\">setup your Raspberry Pi board with noobs<\/a>, which will install <a href=\"https:\/\/www.raspbian.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Raspbian<\/a>, a light weight Linux flavor which comes with lots of tools and support to most Raspberry Pi extensions such as the Pi Camera, which by the way you will need<a rel=\"noreferrer noopener\" href=\"https:\/\/projects.raspberrypi.org\/en\/projects\/getting-started-with-picamera\" target=\"_blank\"> follow this article to configure it.<\/a> If you are like myself, you might prefer to follow the <a rel=\"noreferrer noopener\" href=\"https:\/\/hackernoon.com\/raspberry-pi-headless-install-462ccabd75d0\" target=\"_blank\">headless installation option<\/a> which doesn&#8217;t require an extra screen and keyboard.<\/p>\n\n\n\n<p>During this howto we will be using Face API, so you might go ahead and <a rel=\"noreferrer noopener\" href=\"https:\/\/azure.microsoft.com\/en-us\/free\/\" target=\"_blank\">create an Azure trial free account <\/a>if you don&#8217;t have one. Then create a Face API resource by following these steps.<\/p>\n\n\n\n<p>Search for cognitive services in the Azure portal search bar<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"435\" height=\"157\" src=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image.png?resize=435%2C157\" alt=\"\" class=\"wp-image-57\" srcset=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image.png?w=435&amp;ssl=1 435w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image.png?resize=300%2C108&amp;ssl=1 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/figure>\n\n\n\n<p>Under cognitive services click add.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"207\" src=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-1.png?resize=808%2C207\" alt=\"\" class=\"wp-image-58\" srcset=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-1.png?w=808&amp;ssl=1 808w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-1.png?resize=300%2C77&amp;ssl=1 300w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-1.png?resize=768%2C197&amp;ssl=1 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/figure>\n\n\n\n<p>Search for Face API, click and create. Within few seconds it should be ready for use.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"245\" height=\"373\" src=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-2.png?resize=245%2C373\" alt=\"\" class=\"wp-image-59\" srcset=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-2.png?w=245&amp;ssl=1 245w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/image-2.png?resize=197%2C300&amp;ssl=1 197w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/figure>\n\n\n\n<p>Click go to resource, browse for resource overview and grab the end point the grab the primary key under keys section to be used later in the nodejs script.<\/p>\n\n\n\n<p>Or if you prefer the convenience of a command line like myself, you might fire up your Azure bash shell and type the below command.<\/p>\n\n\n\n<p><code>az cognitiveservices account create -n myresource -g resourcegroup --kind Face --sku S0 -l WestEurope --yes<\/code><\/p>\n\n\n\n<p>Then type this command to get a list with json discription of your cognitive services on Azure so you can grab the endpoint and keys from there<\/p>\n\n\n\n<p><code>az cognitiveservices account list<\/code><\/p>\n\n\n\n<p>Now after we got over the basics and you are now connected to your Raspberry Pi and excited to do cool stuff with it, let&#8217;s start up by installing the tools we will need. Go ahead and open your shell console (or SSH if you did follow the headless installation) and type the following commands to install nodejs, npm and the required npms to be used in this howto. <\/p>\n\n\n\n<p>We start first by updating and upgrading the system packages as a good practice. <\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p><code>sudo apt update<\/code><\/p>\n<\/div><\/div>\n\n\n\n<p><code>sudo apt upgrade<\/code><\/p>\n\n\n\n<p>Then install nodejs and its package manager npm<\/p>\n\n\n\n<p><code>sudo apt install nodejs npm<\/code><\/p>\n\n\n\n<p>You might want to verify your nodejs and npm installation by checking their versions<\/p>\n\n\n\n<div class=\"wp-block-group alignwide\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p><code>nodejs -v<\/code><\/p>\n\n\n\n<p><code>npm -v<\/code><\/p>\n\n\n\n<p>Now we install the nodejs npm packages we are going to use in this howto<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<p><code>npm install request<\/code><\/p>\n\n\n\n<p><code>npm install pi-camera<\/code><\/p>\n<\/div><\/div>\n\n\n\n<p>Using your favorite text editor, which I can&#8217;t dare to even suggest here \ud83d\ude42 However Raspbian does come with vi. Paste <a rel=\"noreferrer noopener\" href=\"https:\/\/raw.githubusercontent.com\/fadyanwar\/An-AIoT-Example-using-Raspberry-Pi-and-Azure-AI\/master\/detectface.js\" target=\"_blank\">this snippet of nodejs, I also placed it on github for your convenience <\/a>and name it detectface.js<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>'use strict';\n\nconst request = require('request');\nconst fs = require(\"fs\");\nconst PiCamera = require('pi-camera');\n\nconst myCamera = new PiCamera({\n    mode: 'photo',\n    output: `${ __dirname }\/photo.jpg`,\n    width: 640,\n    height: 480,\n    nopreview: true,\n  });\n\n\nmyCamera.snap()\n  .then((result) =&gt; {\n    \/\/ Your picture was captured\n\n    \/\/ Replace &lt;Subscription Key&gt; with your valid subscription key.\n    const subscriptionKey = '&lt;Subscription Key&gt; ';\n\n    \/\/put your endppoint url here\n    const uriBase = 'https:\/\/endpoint.cognitiveservices.azure.com\/face\/v1.0\/detect';\n\n    \n    const imageBuffer = fs.readFileSync('photo.jpg'); \/\/I found this easier to debug\n    \n    \/\/ Request parameters.\n    const params = {\n        'returnFaceId': 'true',\n        'returnFaceLandmarks': 'false',\n        'returnFaceAttributes': 'age,gender,headPose,smile,facialHair,glasses,' +\n            'emotion,hair,makeup,occlusion,accessories,blur,exposure,noise'\n    };\n\n    const options = {\n        uri: uriBase,\n        qs: params,\n        body: imageBuffer,\n        headers: {\n            'Content-Type': 'application\/octet-stream',\n            'Ocp-Apim-Subscription-Key' : subscriptionKey\n        }\n    };\n\n    request.post(options, (error, response, body) =&gt; {\n    if (error) {\n        console.log('Error: ', error);\n        return;\n    }\n    let jsonResponse = JSON.stringify(JSON.parse(body), null, '  ');\n    console.log('JSON Response\\n');\n    console.log(jsonResponse);\n    });\n  })\n  .catch((error) =&gt; {\n     \/\/ Handle your error\n     console.log('Error: ', error)\n  });<\/code>\n\n<\/pre>\n\n\n\n<p>Replace the endpoint and subscription key placeholder with your Face API ones you got in Face API setup step and save.<\/p>\n\n\n\n<p>If you did use the headless installation and using a shell, you may use sftp to copy files into your Pi over wifi. By typing the below command.<\/p>\n\n\n\n<p><code>sftp pi@raspberrypi.local<\/code><\/p>\n\n\n\n<p>Then inside the sftp client, use the put command to send your nodejs file to your nodejs file into your Pi.<\/p>\n<\/div><\/div>\n\n\n\n<p>Now you are ready, look at your Pi Camera and smile, type the below command and hit enter<\/p>\n\n\n\n<p><code>node detectface.js<\/code><\/p>\n\n\n\n<p>You should be seeing a json description of your face, something similar to this but not exactly the same \ud83d\ude42 Feel free to tinker with the script, it&#8217;s self explanatory with comments. <\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"635\" src=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/Screenshot-from-2020-05-08-22-55-06.png?resize=939%2C635\" alt=\"\" class=\"wp-image-74\" srcset=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/Screenshot-from-2020-05-08-22-55-06.png?w=939&amp;ssl=1 939w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/Screenshot-from-2020-05-08-22-55-06.png?resize=300%2C203&amp;ssl=1 300w, https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/Screenshot-from-2020-05-08-22-55-06.png?resize=768%2C519&amp;ssl=1 768w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/figure>\n\n\n\n<p>Hope you did enjoy this howto article and now you have some idea about AI and IoT using Azure and Raspberry Pi. Feel free to comment below if you have any questions and if you are interested  <a rel=\"noreferrer noopener\" href=\"https:\/\/twitter.com\/FadyAnwar\" target=\"_blank\">you may follow me<\/a> for <a href=\"http:\/\/fadyanwar.com\/index.php\/2020\/05\/17\/giving-aiot-a-voice-using-azure-ai\/\" target=\"_blank\" rel=\"noreferrer noopener\">more interesting IoT howtos based on what we have done on this one.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AIoT is what you get when you combine AI with IoT, using it you can create very interesting applications, not just your average IoT device that collects telemetry data and uploads it to the cloud, but a device that can do smart things using cloud computing and AI services such as Azure AI. In this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":66,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_vp_format_video_url":"","_vp_image_focal_point":[],"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-52","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>An AIoT Example using Raspberry Pi and Azure AI - Fady Anwar<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An AIoT Example using Raspberry Pi and Azure AI - Fady Anwar\" \/>\n<meta property=\"og:description\" content=\"AIoT is what you get when you combine AI with IoT, using it you can create very interesting applications, not just your average IoT device that collects telemetry data and uploads it to the cloud, but a device that can do smart things using cloud computing and AI services such as Azure AI. In this [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/\" \/>\n<meta property=\"og:site_name\" content=\"Fady Anwar\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-08T22:09:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-26T20:27:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1578\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fady Anwar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fadyanwar\" \/>\n<meta name=\"twitter:site\" content=\"@fadyanwar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fady Anwar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/\"},\"author\":{\"name\":\"Fady Anwar\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"headline\":\"An AIoT Example using Raspberry Pi and Azure AI\",\"datePublished\":\"2020-05-08T22:09:24+00:00\",\"dateModified\":\"2020-05-26T20:27:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/\"},\"wordCount\":869,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"image\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1\",\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/\",\"url\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/\",\"name\":\"An AIoT Example using Raspberry Pi and Azure AI - Fady Anwar\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1\",\"datePublished\":\"2020-05-08T22:09:24+00:00\",\"dateModified\":\"2020-05-26T20:27:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/05\\\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1\",\"width\":2560,\"height\":1578},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/05\\\/08\\\/an-aiot-example-using-raspberry-pi-and-azure-ai\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fadyanwar.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"An AIoT Example using Raspberry Pi and Azure AI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#website\",\"url\":\"https:\\\/\\\/fadyanwar.com\\\/\",\"name\":\"Fady Anwar\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fadyanwar.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\",\"name\":\"Fady Anwar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"caption\":\"Fady Anwar\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"An AIoT Example using Raspberry Pi and Azure AI - Fady Anwar","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/","og_locale":"en_US","og_type":"article","og_title":"An AIoT Example using Raspberry Pi and Azure AI - Fady Anwar","og_description":"AIoT is what you get when you combine AI with IoT, using it you can create very interesting applications, not just your average IoT device that collects telemetry data and uploads it to the cloud, but a device that can do smart things using cloud computing and AI services such as Azure AI. In this [&hellip;]","og_url":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/","og_site_name":"Fady Anwar","article_published_time":"2020-05-08T22:09:24+00:00","article_modified_time":"2020-05-26T20:27:21+00:00","og_image":[{"width":2560,"height":1578,"url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1","type":"image\/jpeg"}],"author":"Fady Anwar","twitter_card":"summary_large_image","twitter_creator":"@fadyanwar","twitter_site":"@fadyanwar","twitter_misc":{"Written by":"Fady Anwar","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#article","isPartOf":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/"},"author":{"name":"Fady Anwar","@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"headline":"An AIoT Example using Raspberry Pi and Azure AI","datePublished":"2020-05-08T22:09:24+00:00","dateModified":"2020-05-26T20:27:21+00:00","mainEntityOfPage":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/"},"wordCount":869,"commentCount":0,"publisher":{"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"image":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1","articleSection":["Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/","url":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/","name":"An AIoT Example using Raspberry Pi and Azure AI - Fady Anwar","isPartOf":{"@id":"https:\/\/fadyanwar.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#primaryimage"},"image":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1","datePublished":"2020-05-08T22:09:24+00:00","dateModified":"2020-05-26T20:27:21+00:00","breadcrumb":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#primaryimage","url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1","contentUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1","width":2560,"height":1578},{"@type":"BreadcrumbList","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fadyanwar.com\/"},{"@type":"ListItem","position":2,"name":"An AIoT Example using Raspberry Pi and Azure AI"}]},{"@type":"WebSite","@id":"https:\/\/fadyanwar.com\/#website","url":"https:\/\/fadyanwar.com\/","name":"Fady Anwar","description":"","publisher":{"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fadyanwar.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03","name":"Fady Anwar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","caption":"Fady Anwar"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g"}}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/05\/raspberry-pi-572481-scaled.jpg?fit=2560%2C1578&ssl=1","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":24,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":179,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/52\/revisions\/179"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/media\/66"}],"wp:attachment":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}