https://github.com/csiebler/unet-pytorch-azureml
An example for running UNET with PyTorch on Azure Machine Learning
https://github.com/csiebler/unet-pytorch-azureml
azure azure-machine-learning pytorch unet-image-segmentation
Last synced: 7 months ago
JSON representation
An example for running UNET with PyTorch on Azure Machine Learning
- Host: GitHub
- URL: https://github.com/csiebler/unet-pytorch-azureml
- Owner: csiebler
- License: mit
- Created: 2020-03-18T12:54:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-18T12:03:08.000Z (about 5 years ago)
- Last Synced: 2023-08-10T00:46:17.964Z (almost 2 years ago)
- Topics: azure, azure-machine-learning, pytorch, unet-image-segmentation
- Language: Python
- Homepage:
- Size: 219 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unet-pytorch-azureml
An example for running a PyTorch-based UNET implementation on Azure Machine Learning.
| Input | Output |
| :---: |:---:|
|  |  |:+1: Credit for the original source code goes to [mateuszbuda/brain-segmentation-pytorch](https://github.com/mateuszbuda/brain-segmentation-pytorch).
Features of this repo:
* Train a PyTorch UNET with [`lgg-mri-segmentation` dataset](https://www.kaggle.com/mateuszbuda/lgg-mri-segmentation) on Azure Machine Learning Compute
* Deploy model as real-time scoring API to ACI (CPU-based) and AKS (GPU-based)
* Support for multi-GPU instances (e.g., `NC12` or `NC24r`)
* Fully automated through Azure DevOps Pipelines for model training and deployment# Instructions
1. Fork this repo
1. Create a new project in Azure DevOps and a Service Connection named `aml-demo`
1. Create a Azure Machine Learning workspace called `aml-demo` in a resource group named `aml-demo`
1. Download the [`lgg-mri-segmentation`](https://www.kaggle.com/mateuszbuda/lgg-mri-segmentation) dataset from Kaggle and put it into a Dataset in Azure Machine Learning, see folder structure:

1. Edit [`train-amlcompute.runconfig`](model/aml_config/train-amlcompute.runconfig) and point it to the id of your newly registered dataset e.g., `id: c7e23b60-04c8-46dc-96c5-d9f741f6234b` (use `az ml dataset list` to get the dataset's id)
1. If you want to configure the resource names of the pipelines, edit [`automation/config.yml`](automation/config.yml)
1. Import and run infrastructure deployment pipeline from [`automation/deploy-infrastructure.yml`](automation/deploy-infrastructure.yml)
1. Import and run model training and registration pipeline from [`automation/train-and-register-model.yml`](automation/train-and-register-model.yml)
1. Import and run model deployment pipeline from [`automation/deploy-model.yml`](automation/deploy-model.yml)
1. Test your endpoints manually, e.g. using [VSCode Rest Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)For running this repo's code locally, see the [`README.md`](model/README.md) in the `model` folder.
```
POST https:// HTTP/1.1< ./docs/test_image.png
#######
POST http:// HTTP/1.1
Authorization: Bearer< ./docs/test_image.png
```| Input image | Output mask (25 epochs) |
| :---: |:---:|
|  |  |# Credits
Credit for the original source code goes to [mateuszbuda/brain-segmentation-pytorch](https://github.com/mateuszbuda/brain-segmentation-pytorch).