David Smith

Hi! I'm David Smith
Data Scientist and Cloud Developer Advocate at Microsoft.
Libraries (View all)

by David M Smith (), Developer Advocate at Microsoft

Last updated: November 2, 2018

Presented at:

  • ODSC West, November 2018

This library includes three notebooks to support the workshop:

  1. The AI behind Seeing AI. Use the web-interfaces to Cognitive Services to learn about the AI services behind the "Seeing AI" app
  2. Computer Vision API with R. Use an R script to interact with the Computer Vision API and generate captions for random Wikimedia images.
  3. Custom Vision with R. An R function to classify an image as a "Hot Dog" or "Not Hot Dog", using the Custom Vision service.

These notebooks are hosted on Azure Notebooks at https://notebooks.azure.com/davidsmi/libraries/aiforgood, where you can run them interactively. You can also download them to run them using Jupyter.

If you get stuck or just have other questions, you can contact me here:

David Smith

Modified on: Nov 13, 2018
EARL: Not Hotdog
0 clones

David M Smith (@revodavid), Developer Advocate at Microsoft

Last updated: September 5, 2018 Clone this library to get the latest updates

This self-guided workshop provides R scripts to demonstrate various AI techniques using the Microsoft Cognitive Services APIs in Azure. The scripts are provided as Jupyter Notebooks within the Azure Notebooks service. You don't need a Microsoft Account to view the scripts, but you will need to set one up and generate keys in Azure to run the examples. All of the examples use free Azure services.

If you're new to Notebooks, check out the Jupyter Notebook documentation.

If you're new to R, you might want to start with this Introduction to R notebook to get a sense of the language.

You will need:

  1. A Microsoft account. You can use an existing Outlook 365 or Xbox Live account, or create a new one.

  2. A Microsoft Azure subscription. If you don't already have an Azure subscription, you can visit https://cda.ms/kT and also get $200 in credits to use with paid services. You'll need to provide a credit or debit card, but everything we'll be doing is free to use. If you're a student, you can also register at https://cda.ms/kY without a credit card for a $100 credit.

You'll also need a few other things specific to this workshop. Follow the instructions below to set up everything you need.

  1. Visit https://portal.azure.com
  2. Sign in with your Microsoft Account. If you don't have a Microsoft account, use the links above to create one for free.

In Azure, a Resource Group is a collection of services you have created. It groups services together, and makes it easy to bulk-delete things later on. We'll create one for this lab.

  1. Visit https://portal.azure.com (and sign in if needed)
  2. Click "Resource Groups" in the left column
  3. Click "+ Add"
    • Resource Group Name: qcon
    • Subscription: there should be just one option
    • Resource Group Location: East US
  4. Click "Create"

A notification will appear in the top right. Click the button "Pin to Dashboard" to pin this resource group to your home page in the Azure portal, as you'll be referring to it frequently.

  1. Visit https://portal.azure.com (and sign in if needed)
  2. Click "+ Create a Resource" (top-left corner)
  3. Click "AI + Cognitive Services"
  4. Click "Computer Vision API"
    • Name: qcon-vision
    • Subscription: there should be just one option
    • Location: East US
    • Pricing Tier: F0 (free, 20 calls per minute)
    • Resource Group: Use existing "qcon" group
  5. Click "Create""
  1. Visit https://portal.azure.com (and sign in if needed)
  2. Click "+ Create a Resource" (top-left corner)
  3. With the "Search the Marketplace" box, search for "Custom Vision Service"
  4. Select "Custom Vision Service (preview)" and click "Create"
    • Name: qcon-customvision
    • Subscription: there should be just one option
    • Location: South Central US
    • Prediction Pricing Tier: F0 (free, 2 transactions per second)
    • Training pricing Tier: F0 (2 projects)
    • Resource Group: Use existing "qcon" group
  5. Click "Create"
  1. Visit https://notebooks.azure.com/davidsmi/libraries/qcon
    • Sign in with your Microsoft account if needed
  2. click Clone in the toolbar, to create a copy of the workshop materials

Download the file and provide the keys listed from the Azure Portal.

(To download this file, highlight it in the Library view and then press or click the download icon in the toolbar.)

For the first line of the file, , change it to . For the remaining keys, visit your resource group in the Azure Portal and then:

  1. Click on the API resource for Computer Vision

  2. In the menu, click on "keys"

  3. Click the "copy to clipboard" next to KEY 1. (You can ignore KEY 2).

  4. Paste the key into the entry in keys.txt

  5. Click on the API resource for Custom Vision

  6. In the menu, click on "keys"

  7. Click the "copy to clipboard" next to KEY 1. (You can ignore KEY 2).

  8. Paste the key into the entry in keys.txt

  9. Click on the API resource for Custom Vision (this resource was created automatically for you).

  10. In the menu, click on "keys"

  11. Click the "copy to clipboard" next to KEY 1. (You can ignore KEY 2).

  12. Paste the key into the entry in keys.txt

Your final file will look like this, but with different (working) keys:

Once you've done this for all the cognitive services, save the file and upload it to replace the existing file in Azure Notebooks. To upload the modified file, go to the Library and press the "+" (New File) icon or press , click "From Computer" > "Choose Files" and select the file on your hard drive, and click "Upload". A box saying "File Exists, Overwrite?" will appear; click it to continue.

The R scripts are provided as Jupyter Notebook files (with the extension). You can tackle the files in any order, but we recommend the following sequence:

  1. : Explore analyzing images from Wikimedia Commons using the Microsoft Vision API
  2. : Create the "Not Hotdog" image recognition application featured in Silicon Valley

For more examples of using the Cognitive Services APIs from R, take a look a the following blog posts. R code is included in the posts or in linked Github repositories.

If you get stuck or just have other questions, you can contact me here:

David Smith

Modified on: Sep 6, 2018
This introduction to R provides a first look into a number of R functionalities, inluding reading data, processing data, and modeling. It includes dives into extremely useful packages such as dplyr and caret.
Modified on: Apr 9, 2018

by David M Smith (), Cloud Advocate at Microsoft

Last updated: December 4, 2018

Presented at:

  • AI Live (AIF01), Orlando, December 7 2018

This library includes three notebooks to support the workshop:

  1. The AI behind Seeing AI. Use the web-interfaces to Cognitive Services to learn about the AI services behind the "Seeing AI" app
  2. Computer Vision API with R. Use an R script to interact with the Computer Vision API and generate captions for random Wikimedia images.
  3. Custom Vision with R. An R function to classify an image as a "Hot Dog" or "Not Hot Dog", using the Custom Vision service.
  4. MNIST with scikit-learn. Use sckikit-learn to build a digit recognizer for the MNIST data using a regression model.
  5. MNIST with tensorflow. Use Tensorflow (from Python) to build a digit recognizer for the MNIST data using a convolutional neural network.

These notebooks are hosted on Azure Notebooks at https://notebooks.azure.com/davidsmi/projects/practicalai, where you can run them interactively. You can also download them to run them using Jupyter.

Find the slides for the workshop here.

  • Sign in to Azure Notebooks. You'll need a Microsoft Account: your O365, Xbox, or Hotmail account will work.

If you're new to Notebooks, check out the Jupyter Notebook documentation and the Azure Notebook documentation.

  • If you have an iPhone, install the free SeeingAI app.

  • (optional) To generate keys and use Azure services, you'll need an Azure subscription. You can get a free Azure account here, with $200 in free credits for new subscribers. You'll need a credit card, but most of the things we'll use in this workshop will be free.

If you get stuck or just have other questions, you can contact me here:

David Smith Twitter: @revodavid

Modified on: Dec 7, 2018

David M Smith (@revodavid), Developer Advocate at Microsoft

Last updated: April 9, 2018 Clone this library to get the latest updates

This self-guided workshop provides R scripts to demonstrate various AI techniques using the Microsoft Cognitive Services APIs in Azure. The scripts are provided as Jupyter Notebooks within the Azure Notebooks service. You don't need a Microsoft Account to view the scripts, but you will need to set one up and generate keys in Azure to run the examples. All of the examples use free Azure services.

If you're new to Notebooks, check out the Jupyter Notebook documentation.

If you're new to R, you might want to start with this Introduction to R notebook to get a sense of the language.

You will need:

  1. A Microsoft account. You can use an existing Outlook 365 or Xbox Live account, or create a new one.

  2. A Microsoft Azure subscription. If you don't already have an Azure subscription, you can visit https://cda.ms/kT and also get $200 in credits to use with paid services. You'll need to provide a credit or debit card, but everything we'll be doing is free to use. If you're a student, you can also register at https://cda.ms/kY without a credit card for a $100 credit.

You'll also need a few other things specific to this workshop. Follow the instructions below to set up everything you need.

  1. Visit https://portal.azure.com
  2. Sign in with your Microsoft Account. If you don't have a Microsoft account, use the links above to create one for free.

In Azure, a Resource Group is a collection of services you have created. It groups services together, and makes it easy to bulk-delete things later on. We'll create one for this lab.

  1. Visit https://portal.azure.com (and sign in if needed)
  2. Click "Resource Groups" in the left column
  3. Click "+ Add"
    • Resource Group Name: qcon
    • Subscription: there should be just one option
    • Resource Group Location: East US
  4. Click "Create"

A notification will appear in the top right. Click the button "Pin to Dashboard" to pin this resource group to your home page in the Azure portal, as you'll be referring to it frequently.

  1. Visit https://portal.azure.com (and sign in if needed)
  2. Click "+ Create a Resource" (top-left corner)
  3. Click "AI + Cognitive Services"
  4. Click "Computer Vision API"
    • Name: qcon-vision
    • Subscription: there should be just one option
    • Location: East US
    • Pricing Tier: F0 (free, 20 calls per minute)
    • Resource Group: Use existing "qcon" group
  5. Click "Create""
  1. Visit https://portal.azure.com (and sign in if needed)
  2. Click "+ Create a Resource" (top-left corner)
  3. With the "Search the Marketplace" box, search for "Custom Vision Service"
  4. Select "Custom Vision Service (preview)" and click "Create"
    • Name: qcon-customvision
    • Subscription: there should be just one option
    • Location: South Central US
    • Prediction Pricing Tier: F0 (free, 2 transactions per second)
    • Training pricing Tier: F0 (2 projects)
    • Resource Group: Use existing "qcon" group
  5. Click "Create"
  1. Visit https://notebooks.azure.com/davidsmi/libraries/qcon
    • Sign in with your Microsoft account if needed
  2. click Clone in the toolbar, to create a copy of the workshop materials

Download the file and provide the keys listed from the Azure Portal.

(To download this file, highlight it in the Library view and then press or click the download icon in the toolbar.)

For the first line of the file, , change it to . For the remaining keys, visit your resource group in the Azure Portal and then:

  1. Click on the API resource for Computer Vision

  2. In the menu, click on "keys"

  3. Click the "copy to clipboard" next to KEY 1. (You can ignore KEY 2).

  4. Paste the key into the entry in keys.txt

  5. Click on the API resource for Custom Vision

  6. In the menu, click on "keys"

  7. Click the "copy to clipboard" next to KEY 1. (You can ignore KEY 2).

  8. Paste the key into the entry in keys.txt

  9. Click on the API resource for Custom Vision (this resource was created automatically for you).

  10. In the menu, click on "keys"

  11. Click the "copy to clipboard" next to KEY 1. (You can ignore KEY 2).

  12. Paste the key into the entry in keys.txt

Your final file will look like this, but with different (working) keys:

Once you've done this for all the cognitive services, save the file and upload it to replace the existing file in Azure Notebooks. To upload the modified file, go to the Library and press the "+" (New File) icon or press , click "From Computer" > "Choose Files" and select the file on your hard drive, and click "Upload". A box saying "File Exists, Overwrite?" will appear; click it to continue.

The R scripts are provided as Jupyter Notebook files (with the extension). You can tackle the files in any order, but we recommend the following sequence:

  1. : Explore analyzing images from Wikimedia Commons using the Microsoft Vision API
  2. : Create the "Not Hotdog" image recognition application featured in Silicon Valley

For more examples of using the Cognitive Services APIs from R, take a look a the following blog posts. R code is included in the posts or in linked Github repositories.

If you get stuck or just have other questions, you can contact me here:

David Smith

Modified on: Nov 2, 2018
  • The story revolves around image processing in R
  1. Introduction, history and perspective (basically general context)
  2. Jupyter notebook inner workings in the context of the R kernel ( package)
  • Tour of Notebooks and Short Image Analysis Lab
  • Become familiar with the anatomy of notebooks
  • Learn how to efficiently navigate and work with notebooks
  • Gain some practice using shortcuts
  • Perform a short image analysis lab
  • Reproducible research - how Jupyter and R can address this
  • Expanded image analysis lab
  • Become comfortable building out a solution in notebooks with R and making it reproducible
  • Gain/regain the experience of a "hackathon" style lab involving collaboration
  • Become more comfortable and familiar with the notebook shortcuts and tools
  • Get some experience doing image color quantization
  • Microsoft Azure and Jupyter notebooks (they've got a few services available)
  • Teaching, training and workshoping with Jupyter notebooks
  • Wrap up
  • Jupyter's power is in having code, data, and text all accessible from one file viewed in a browser, living locally or in the cloud.
  • The Jupyter Project used to be part of the IPython Project and has spun off.
  • It supports over 40 different languages (see this article) and that is actively growing.

The text in a notebook is written in the simple markdown language, making it a rich format capable of "rendering" latex, links, images and even html (since we're in a browser and the R kernel let's us).

Amazing fact: in 2014, there were 80,000 jupyter notebooks on github. In 2015 the number almost tripled to 230,000. This shows how popular and fast-growing the usage is in the community.

  • github numbers from article by Alex Perrier here
Modified on: Apr 5, 2018
Starred Libraries (View all starred libraries)