isabella232 / batch-scoring-for-dl-models

Batch Scoring For Deep Learning Models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Batch Scoring on Azure for Deep Learning Models

Overview

In this repository, we use the scenario of applying style transfer onto a video (collection of images). This architecture can be generalized for any batch scoring with deep learning scenario.

Design

Reference Architecture Diagram

The above architecture works as follows:

  1. Upload your selected style image (like a Van Gogh painting) and your style transfer script to Blob Storage.
  2. Split up your video into individual frames and upload those frames into Blob Storage.
  3. Logic App will then be triggered, and will create an ACI that runs a Batch AI job creation script.
  4. The script running in ACI will create the Batch AI jobs. Each job will apply the style transfer in parallel across the nodes of the Batch AI cluster.
  5. Once the images are generated, they will be saved back to Blob Storage.
  6. Finally, you can download the generates frames, and stitch back the images into a video.

Style Transfer for Video

Style image: Input/content video: Output video:
click to view video click to view video

Prerequisites

Local/Working Machine:

Accounts:

While it is not required, it is also useful to use the Azure Storage Explorer to inspect your storage account.

Setup

  1. Clone the repo git clone <repo-name>
  2. cd into the repo
  3. Setup your conda env using the environment.yml file conda env create -f environment.yml - this will create a conda environment called batchscoringdl
  4. Activate your environment source activate batchscoringdl
  5. Log in to Azure using the az cli az login
  6. Log in to Docker using the docker cli docker login

Steps:

Run through the following notebooks:

  1. Apply style transfer locally
  2. Download and preprocess the video
  3. Setup Azure
  4. Run style transfer at scale
  5. Run the Batch AI job from Docker
  6. Deploy and test Logic Apps
  7. Stitch together the results

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Batch Scoring For Deep Learning Models

License:MIT License


Languages

Language:Jupyter Notebook 68.3%Language:Python 31.2%Language:Shell 0.5%