Automated deployment - AWS Content Analysis

Automated deployment

Before you launch the solution, review the architecture, configuration, network security, and other considerations discussed in this guide. Follow the step-by-step instructions in this section to configure and deploy the solution into your account.

Time to deploy: Approximately 20 minutes

Deployment overview

Use the following steps to deploy this solution on AWS. For detailed instructions, follow the links for each step.

Step 1. Launch the stack

  • Launch the AWS CloudFormation template into your AWS account.

  • Enter values for required parameters: AdminEmail and DeployDemoSite.

Step 2. Access the web application

  • Identify the URL.

Step 3. Upload a video

Step 4. Search a video

  • Use full text queries.

  • Search high confidence data.

  • Search data from individual operators.

  • Search related concepts across multiple operators.

Step 5. (Optional) Create user accounts

Step 1. Launch the stack

Important

This solution includes an option to send anonymous operational metrics to AWS. We use this data to better understand how customers use this solution and related services and products. AWS owns the data gathered though this survey. Data collection is subject to the AWS Privacy Policy.

To opt out of this feature, download the template, modify the AWS CloudFormation mapping section, and then use the AWS CloudFormation console to upload your template and deploy the solution. For more information, refer to the Collection of operational metrics section of this guide.

This automated AWS CloudFormation template deploys the solution in the AWS Cloud.

Note

You are responsible for the cost of the AWS services used while running this solution. For more details, visit the Cost section in this guide, and refer to the pricing webpage for each AWS service used in this solution.

  1. Sign in to the AWS Management Console and select the button below to launch the aws-content-analysis.template AWS CloudFormation template.

    
              AWS Content Analysis launch button

    Alternatively, you can also download the template as a starting point for your own implementation.

  2. The template launches in the US East (N. Virginia) Region by default. To launch the solution in a different AWS Region, use the Region selector in the console navigation bar.

    Note

    This solution uses the Amazon Rekognition, Amazon Translate, Amazon Comprehend, and Amazon Transcribe services, which are currently available in specific AWS Regions only. Therefore, you must launch this solution in an AWS Region where these services are available. For the most current availability by Region, refer to the AWS Regional Services List.

  3. On the Create stack page, verify that the correct template URL shows in the Amazon S3 URL text box and choose Next.

  4. On the Specify stack details page, assign a name to your solution stack.

  5. Under Parameters, review the parameters for the template and modify them as necessary. This solution uses the following default values.

    Parameter Default Description
    AdminEmail <Requires input> Email address for the MIE administrator. This user receives an email with a temporary password to the web application once the AWS CloudFormation template has launched.
    OpenSearchNodeSize

    t3.small.search

    The node type to be provisioned for the Amazon OpenSearch Service. The default value for this parameter is t3.small.search. For information about which instance type is appropriate for your use case, refer to Sizing Amazon OpenSearch Service domains.

  6. Choose Next.

  7. On the Configure stack options page, choose Next.

  8. On the Review page, review and confirm the settings. Check the box acknowledging that the template will create AWS Identity and Access Management (IAM) resources and may require an AWS CloudFormation capability.

    Note

    This solution may require an AWS CloudFormation capability: CAPABILITY_AUTO_EXPAND, which is a parameter that supports the use of macros. For information about this AWS CloudFormation capability, refer to CreateStack in the AWS CloudFormation API Reference.

  9. Choose Create stack to deploy the stack.

    You can view the status of the stack in the AWS CloudFormation console in the Status column. You should receive a status of CREATE_COMPLETE in approximately 20 minutes.

Step 2. Access the web application

After the solution successfully launches, you can access the web application. The solution sends an email containing information to access the web application, including a temporary password.

Identify the URL

Use the following procedure to identify the URL for the web application. This will allow you to sign in.

  1. Navigate to the AWS CloudFormation console and select the solution’s stack.

  2. On the Stacks page, select the ContentAnalysisWebStack nested stack and select the Outputs tab.

  3. On the Outputs page, Key column, locate CloudfrontURL, select the corresponding Value, and open the web application in a new tab or browser window.

    
              Web application URL

    Figure 3: Web application URL

  4. Sign in with your username and temporary password, then create a new password when prompted.

Figure 5 shows the AWS Content Analysis web application.


          AWS Content Analysis web application home page

Figure 4: AWS Content Analysis web application home page

Step 3. Upload a video

Use the following procedure to upload videos and to start an analysis.

  1. Sign in to the AWS Content Analysis web application and choose Upload.

  2. From the Upload Videos page, drag and drop one or more media files into the upload box as shown in Figure 6.

    
            Upload videos page

    Figure 5: Upload videos page

  3. To deactivate any of the analysis operators, choose Configure Workflow. By default, all analysis operators are activated, as shown in Figure 6. Operator descriptions are included in Guide to analysis operators.

    
            Workflow Operator categories

    Figure 6: Workflow Operator categories

  4. To start the analyses, choose Upload and Run Workflow.

After the workflow has completed, a table appears below the Operator categories to verify that the video was successfully uploaded and analyzed.

Step 4. Search a video

The workflow operators analyze the media file and indexes and then catalog the information in an Amazon OpenSearch Service (successor to Amazon Elasticsearch Service) instance. You can search all aspects of a media file using Lucene, the Amazon OpenSearch Service query language. The following examples show common search patterns using Amazon OpenSearch Service.

Use full-text queries

Full-text queries allow you to search for any type of data that exists in the video catalog. For example, the Amazon Rekognition celebrity detection service will return the full names of celebrities detected in a video. Figure 8 shows a search for a celebrity by first and last name. Figure 9 shows the search results.


          Using the search function in the web application

Figure 7: Using the search function in the web application


          Search results in the web application

Figure 8: Search results in the web application

Search high confidence data

After the analysis workflow completes, labels returned by Amazon Rekognition are assigned a confidence value. You can use that value to filter search results. For example, Violence AND Confidence:>80 will search for videos containing violence with an 80% or higher confidence threshold.

Search data from individual operators

Searches will query the metadata catalog in Amazon OpenSearch Service. For example, a search for the term violence would match videos containing the violence label from content moderation and would also match video transcripts that contain the word violence. You can restrict your search to focus Content Moderation results with operator names, for example: Operator:content_moderation AND (Name:violence AND Confidence:>80).

You can use the following operator names to filter search queries:

  • label_detection

  • celebrity_detection

  • content_moderation

  • face_detection

  • transcribe

  • key_phrases

  • entities

You can also conduct compound searches using multiple operator names. For example, the following search query will return violence identified by content moderation and guns or weapons identified by label detection: (Operator:content_moderation AND Name:Violence AND Confidence:>80) OR (Operator:label_detection AND (Name:Gun OR Name:Weapon)).

Step 5. (Optional) Create user accounts

If more than one person needs access to the web application, then the solution administrator can set up additional users with the following procedure in Amazon Cognito.

  1. Sign in to the Amazon Cognito console.

  2. Choose Manage User Pools.

  3. In the Your User Pools page, select the name of the user pool containing the prefix MIE.

  4. On the MieUserPool page, from the left navigation pane, choose Users and Groups.

  5. On the Users tab, choose Create user.

    
            Amazon Cognito user pools create a user

    Figure 9: Amazon Cognito user pools create a user

  6. In the Create user dialog box, enter a username and temporary password (ensure the options to send an invitation to the user and the verifications for phone number and email are not selected).

  7. Choose Create user.

  8. On the MieUserPool page, under the Username column, select the user you just created.

    
            Amazon Cognito user pools page

    Figure 10: Amazon Cognito user pools page

  9. On the Users page, choose Add to group.

  10. In the Add user dialog box, access the drop-down list and select MieDevelopersGroup.

    
            Add a user to a group

    Figure 11: Add a user to a group

The user can now access the web application, upload media files, and run the analysis workflows.

Note

(Optional) We strongly encourage you to also set up Multi-Factor Authentication (MFA) for each new user. For details, refer to Adding Multi-Factor Authentication (MFA) to a User Pool in the Amazon Cognito Developer Guide.