Image Classification using Tensorflow

This sample uses functions to classify an image from a pretrained Inception V3 model using tensorflow API's

Getting Started

Deploy to Azure


  • Install Python 3.6+
  • Install Functions Core Tools
  • Install Docker
  • Note: If run on Windows, use Ubuntu WSL to run deploy script


  • Click Deploy to Azure Button to deploy resources

Deploy to Azure


  • Deploy through Azure CLI

    • Open AZ CLI and run az group create -l [region] -n [resourceGroupName] to create a resource group in your Azure subscription (i.e. [region] could be westus2, eastus, etc.)
    • Run az group deployment create --name [deploymentName] --resource-group [resourceGroupName] --template-file azuredeploy.json
  • Download pretrained inception V3 model

    • Clone this repository and copy classify_image_graph_def.pb from here to the InceptionV3Classifier folder
  • Deploy Function App to Azure

    • Run func azure functionapp publish [functionAppName] --build-native-deps
  • Local Development

    • Refer links below to create/activate virtual environment for local development


  • Send the following body in a HTTP POST request as a query param
http://[functionappname]/api/InceptionV3Classifier?img=[url of image]

Local Testing

For any local testing, use the sample local.settings.json and host.json, create virtual environment and run func host start


http post https://[functionappname]\?img\=

    "tiger, Panthera tigris (score = 0.86580)"

Note: If using Postman, remove the escape characters from the query param of the URL.