This post comes with a python notebook where we explain all the steps you need to follow for deploying a deep neural network through an API to perform image classification.
In a previous post, we saw how to train a Convolutional Neural Network (CNN), now we are going to see how to create an API that classifies images in the cloud. The frameworks used in the solution are:
The main procedure is executed by a CNTK CNN. The network is a pretrained ResNet with 152 layers. The CNN was trained on ImageNet dataset, which contains 1.2 million images divided into 1000 different classes.
The CNN is accessible through the flask API, which provides an endpoint
/api/v1/classify_image that can be called to classify an image. CherryPy is the server framework where the application is hosted. It also balances the load, in such a way that several concurrent queries can be executed. Externally, there is the client, which can be any desktop or mobile. It sends an image to the application for analysis and receives the response.
If you want to understand the end to end process, take a look at this notebook.