page_type | languages | products | description | azureDeploy | |||
---|---|---|---|---|---|---|---|
sample |
|
|
This sample uses functions to classify an image from a pretrained Inception V3 model using tensorflow APIs. |
This sample uses functions to classify an image from a pretrained Inception V3 model using tensorflow API's
- 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
or
-
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
- Open AZ CLI and run
-
Download pretrained inception V3 model
-
Deploy Function App to Azure
- Run
func azure functionapp publish [functionAppName] --build-native-deps
- Run
-
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]
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].azurewebsites.net/api/inceptionv3classifier\?img\=https://www.balisafarimarinepark.com/wp-content/uploads/2017/11/19437535_10154869044788931_4755399083724169206_n-671.jpg
[
"tiger, Panthera tigris (score = 0.86580)"
]
Note: If using Postman, remove the escape characters from the query param of the URL.