Data being used in this project is V2: Nonsegmented single plants (1.7GB) from PAPER: A Public Image Database for Benchmark of Plant Seedling Classification Algorithms.
It contains about 960 unique plants of 12 classes:
└── NonsegmentedV2
├── Black-grass
├── Charlock
├── Cleavers
├── Common Chickweed
├── Common wheat
├── Fat Hen
├── Loose Silky-bent
├── Maize
├── Scentless Mayweed
├── Shepherd’s Purse
├── Small-flowered Cranesbill
└── Sugar beet
More information can be found from Plant Seedlings Dataset.
The details can be found in notebooks/UNDP.ipynb
and can be run with Colab.
Requirements:
- Configure Azure Notification Hub and connect app to the notification hub. (See Tutorial: Send push notifications to Android devices using Firebase SDK version 0.6).
- Replace
<ConnectionString>
and<HubName>
inundp/classify/__init__.py
withDefaultFullSharedAccessSignature
and name of the hub you have configured.
cr. fastai
- Open your terminal and change directory to
undp
- Build Docker image
docker build --tag <DOCKER_HUB_ID>/<DOCKER_IMAGE_NAME>: .
- Test Docker image
docker run -p 8080:80 -it <DOCKER_HUB_ID>/<DOCKER_IMAGE_NAME>:
- Open browser:
localhost:8080/api/classify?name=https://raw.githubusercontent.com/nithiroj/azure-undp-weed-detection/master/assets/maize-251.png
- Push the image to Docker Hub
docker login
docker push <DOCKER_HUB_ID>/<DOCKER_IMAGE_NAME>:
cr. fastai
- Login to Microsoft Azure with Azure CLI
az login
- Run following command to see list of available location for
<LOCATION_ID>
, e.g.centralus
. - Create resource group
az group create \
--name <RESOURCE_GROUP> \
--location <LOCATION_ID> - Create storage account
az storage account create \
--name <STORAGE_ACCOUNT> \
--location <LOCATION_ID> \
--resource-group <RESOURCE_GROUP> \
--sku Standard_LRS - Create a Linux App Service Plan
az appservice plan create \
--name <APP_PLAN_NAME> \
--resource-group <RESOURCE_GROUP> \
--sku B1 \
--is-linux - Create the App & Deploy the Docker image from Docker Hub
az functionapp create \
--resource-group <RESOURCE_GROUP> \
--name <FUNCTION_APP> \
--storage-account <STORAGE_ACCOUNT> \
--plan <APP_PLAN_NAME> \
--deployment-container-image-name <DOCKER_HUB_ID>/<DOCKER_IMAGE_NAME>: - Configure the function app
storageConnectionString=$(az storage account show-connection-string \
--resource-group <RESOURCE_GROUP> \
--name <STORAGE_ACCOUNT> \
--query connectionString --output tsv) az functionapp config appsettings set --name <FUNCTION_APP> \
--resource-group <RESOURCE_GROUP> \
--settings AzureWebJobsDashboard=$storageConnectionString \
AzureWebJobsStorage=$storageConnectionString - Run your Azure Function
https://<FUNCTION_APP>.azurewebsites.net/api/classify?name=<IMAGE_URL>
When you are done, delete the resource group
az group delete \
--name <RESOURCE_GROUP> \
--yes
The demo can be tested by replacing <IMAGE_URL>
with your image url.
https://undpinferenceapp.azurewebsites.net/api/classify?name=<IMAGE_URL>
For example:
Note:
- More samples of images are avilable in
assets/
- The demo will be available until the end of June 2020.