Inspiration

My story -

My joblessness on H-4 dependent Visa inspired me to start my own startup https://m.facebook.com/groceriesandveggies/

While running my start up I fell in love with Facebook business and Facebook ads because it helped several enthusiastic entrepreneurs like me to build up their business. Challenges in handling digital marketing data and taking data driven decisions in business inspired me to self learn data science. Fast.ai lessons and forums helped me understand PyTorch and self learn deep learning. With this inspiration I wanted to implement end-to-end solution on one of the major cloud providers like GCP, AWS or Azure. Though there are several tutorials for AWS and GCP there are very few blogs/articles/GitHub resources implementing PyTorch on azure platform using azure machine learning sdk showcasing end-to-end web-service deployment and integration into a web app

What it does

It classifies baby as happy or crying and if crying plays Tom and Jerry video to make them smile.

How I built it

  • Data collection and prototyping in Google Colab
  • Training on Azure Machine Learning
  • Deployment as Azure Web Service
  • Consuming the web service from front end deployed as a Python flask Azure Web app.

Data collection: In this project I downloaded crying babies and happy babies from google images and quickly tested them in google colab for initial baseline. Check my Google colab notebook.

Training on Azure Machine Learning: After initial baseline, I chose Microsoft Azure for training and deployment as a web app. I created a blog post with detailed steps for the benefit of others.

Deployment as Azure Web Service This was the toughest part of all the steps. Understanding compute requirements for doing inference on CPU using Pytorch and fastai was tedious. Writing Azure web container instance deployment configuration from local conda environment was a tough task and lead to confusion. Included all the bottlenecks in the blog for easy reference.

Consuming the web service from front end deployed as a Python flask Azure Web app Finally, to consume the web-service I wrote a flask app with html and java script front end and deployed it as Azure Web App using local git and Kudu(Kudu is the engine behind git deployments in Azure Web Sites).

My focus was mainly on end-to end deployment of Pytorch solution in a Major cloud service so that the documentation could be useful for others.When my 4 year old was a baby she used to stop crying on watching Tom and Jerry. As the world is fighting COVID-19, hope Tom and Jerry brings some smiles and helps us in soothing our crying baby.

Challenges I ran into

Understanding deployment architecture on Azure while meeting the compute requirements for implementing PyTorch inference on CPU.

Accomplishments that I'm proud of

Deploying Pytorch Image Classifier as webservice in Azure Cloud was itself a big achievement for me.

What I learned

Docker, Containers, Deploying web services, Python Flask web app development.

What's next for Baby Vibes

Deployment on a IoT device - Raspberry Pi to actually detect a crying baby and play Tom and Jerry/or their favorite cartoon to make them all smile.

Github link - https://github.com/SriramyaK/Baby_Vibes_Pytorch_Azure_Webservice

Website link - https://babyvibes.azurewebsites.net/

Azure webservice scoring uri - http://7724f32c-4659-4a04-823d-39ef71e678c5.westus.azurecontainer.io/score

Blog link - https://medium.com/@sriramya.kannepalli/pytorch-web-service-deployment-using-azure-machine-learning-service-and-azure-web-apps-from-vs-code-a1ba75e43520

Built With

Share this project:
×

Updates