This chapter covers:
- Building a first simple AI as a Service system
- Consuming an AI image recognition service
- Implementing synchronous and asynchronous services
- Deploying a UI
- Deploying to the cloud
In Chapter 2 we setup our development environment and deployed the Crawler service. In this chapter we will continue with the deployment of the rest of the system starting with the analysis service.
Let’s take a look at the analysis-service. In a similar manner to the crawler-service, this service is triggered by a message from the Analysis SQS queue once there are images available for analysis in our S3 bucket. An outline of the logic for this service is depicted in Figure 3.25.
Figure 3.1. Analysis Service
In essence the analysis-service forms a bridge between the downloaded images and the Amazon Rekognition service. Each image downloaded by the crawler-service is fed into Rekognition and a set of labels returned. Each label is a word describing the object recognized by the model in the image and a confidence level (a number between 0 and 100 where 100 is full confidence in the image label).
Following this analysis, the service processes the returned data to create a set of word counts that can be fed into a word cloud generator. The idea behind this is to try and visually determine a common thread between the images available at the given URL.