You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notebook for deploying a fine-tuned ResNet18 CNN model using AzureML for Image Similarity (#560)
* Added notebook for deploying a fine-tuned resnet18 CNN model using AzureML that builds on the html_demo notebooks with a custom scoring script that saves the features in the intermediate layers and returns them in JSON format. Also added fix to script.js to support image similarity scenarios.
* Updated readme
* Fixed typo in readme
* Addressed PR comment - removed link in notebook.
* Addressing PR comments: Added descriptions for the notebook and updated its name.
* Addressed PR comment: Made DATA_PATH point to the returned value from unzip_url using our fridge_objects dataset so that the user can just run the notebook.
Copy file name to clipboardExpand all lines: contrib/html_demo/JupyterCode/readme.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ This directory contains a few helper notebooks that upload files and deploy mode
10
10
|[1_image_similarity_export.ipynb](1_image_similarity_export.ipynb)| Exports computed reference image features for use in visualizng results (see details in "Image Similarity" section below) |
11
11
|[2_upload_ui.ipynb](2_upload_ui.ipynb)| Uploads web page files to Azure Blob storage |
12
12
|[3_deployment_to_azure_app_service.ipynb](3_deployment_to_azure_app_service.ipynb)| Deploys image classification model as an Azure app service |
13
+
| [4_train_and_deploy_custom_image_similarity_webapp.ipynb](4_train_and_deploy_custom_image_similarity_webapp.ipynb) | Fine-tunes a ResNet18 CNN model and deploys a custom image similarity webapp using AzureML
13
14
14
15
### Requirements
15
16
@@ -28,14 +29,15 @@ To run the code in the [2_upload_ui.ipynb](2_upload_ui.ipynb) notebook, you must
28
29
* If you want to use an image similarity model, you can run [1_image_similarity_export.ipynb](1_image_similarity_export.ipynb) to export your image features for the web page to use.
29
30
* To upload the web page for sharing, notebook [2_upload_ui.ipynb](2_upload_ui.ipynb) outlines the process of uploading to your Azure Blob storage.
30
31
* As the web page needs the API to allow CORS, we recommend uploading models as an Azure app service. Notebook [3_deployment_to_azure_app_service.ipynb](3_deployment_to_azure_app_service.ipynb) gives a tutorial on how to do so with an image classification model.
32
+
*[4_train_and_deploy_custom_image_similarity_webapp.ipynb](4_train_and_deploy_custom_image_similarity_webapp.ipynb) guides through the process of deploying a custom image similarity web application - from finetuning a RESNET50 model using a sample dataset in ImageNet directory structure format to updating required files for the web application and deploying them along with the model.
31
33
32
34
### Image Similarity
33
35
34
36
Image similarity relies on comparing DNN features of a query image, to the respective DNN features of potentially tens of thousands of references images. The notebooks in this directory compute these reference image DNN features and package them for use in the HTML UI. The DNN features are exported into a text file and compressed to be uploaded with the HTML UI files. To compare a query image to these exported reference image features, you will need a DNN model deployed to Azure App services that is able to compute the features of the query image and return them via API call.
35
37
36
38
Steps:
37
-
1. Execute "1_image_similarity_export.ipynb" notebook to generate your reference image features and export them to compressed ZIP files
38
-
2. Execute "2_upload_ui.ipynb" notebook to upload the HTML UI and all supporting files to your Azure Blob storage account
39
-
3. Execute "3_deployment_to_azure_app_service.ipynb" notebook to upload your model for generating DNN features for your query image and create an API endpoint in Azure App service
39
+
1. Execute [1_image_similarity_export.ipynb](1_image_similarity_export.ipynb) notebook to generate your reference image features and export them to compressed ZIP files
40
+
2. Execute [2_upload_ui.ipynb](2_upload_ui.ipynb) notebook to upload the HTML UI and all supporting files to your Azure Blob storage account
41
+
3. Execute [3_deployment_to_azure_app_service.ipynb](3_deployment_to_azure_app_service.ipynb) notebook to upload your model for generating DNN features for your query image and create an API endpoint in Azure App service
40
42
4. Open the index.html file from your Blob storage account in a browser, enter your API endpoint URL, upload a query image and see what you get back
41
-
43
+
5.*(Optional)* Execute [4_train_and_deploy_custom_image_similarity_webapp.ipynb](4_train_and_deploy_custom_image_similarity_webapp.ipynb) notebook to finetune a RESNET50 model and deploy a custom image similarity web application
0 commit comments