Git Product home page Git Product logo

awslabs / media-analysis-solution Goto Github PK

View Code? Open in Web Editor NEW
75.0 16.0 47.0 2.97 MB

This Solutions Implementation has been superseded by AWS Content Analysis at https://aws.amazon.com/solutions/implementations/aws-content-analysis/.

Home Page: https://aws.amazon.com/solutions/implementations/media-analysis-solution/

License: Apache License 2.0

Shell 1.13% JavaScript 98.25% HTML 0.12% CSS 0.49%

media-analysis-solution's Introduction

Media Analysis Solution

The increasing maturity and growing availability of machine learning (ML) algorithms and artificial intelligence (AI) services have unlocked new frontiers in analytics across several forms of media. Through the use of AI tools and services, it is possible to detect objects, recognize faces, transcribe and analyze audio, and much more. Advancements in deep learning algorithms and AI tooling have enabled developers and analysts to efficiently extract valuable data from multimedia sources, but can still require a great deal of time and effort to train ML models as well as maintain supporting infrastructure.

AWS offers several managed AI services, such as Amazon Rekognition, Amazon Transcribe, and Amazon Comprehend, that offer immediate insights into image, video, and audio files. By combining these services with Amazon's managed storage and compute services, customers can quickly and easily build intelligent applications that inform and enable many use cases across a variety of fields, including public safety and security, media and entertainment, advertising and social media, etc.

The Media Analysis Solution is a turnkey reference implementation that helps customers start analyzing their media files using serverless, managed AI services. The Media Analysis Solution uses highly available, highly scalable, and highly accurate AWS-native services to automatically extract valuable metadata from audio, image, and video files.

For more information and a detailed deployment guide visit the Media Analysis Solution at https://aws.amazon.com/solutions/media-analysis-solution/.

Running unit tests for customization

  • Clone the repository, then make the desired code changes
  • Next, run unit tests to make sure added customization passes the tests
cd ./deployment
chmod +x ./run-unit-tests.sh
./run-unit-tests.sh

Building distributable for customization

  • Create an Amazon S3 Bucket
aws s3 mb s3://my-bucket-us-east-1 --region us-east-1
  • Navigate to the deployment folder and build the distributable
chmod +x ./build-s3-dist.sh
./build-s3-dist.sh my-bucket media-analysis-solution my-version

Note: The build-s3-dist script expects the bucket name as one of its parameters, and this value should not include the region suffix.

  • Deploy the distributable to an Amazon S3 bucket in your account (you must have the AWS CLI installed)
aws s3 cp ./regional-s3-assets/ s3://my-bucket-us-east-1/media-analysis-solution/my-version --recursive --acl bucket-owner-full-control
  • Get the link of the media-analysis-deploy.template uploaded to your Amazon S3 bucket.
  • Deploy the Media Analysis Solution to your account by launching a new AWS CloudFormation stack using the link of the media-analysis-deploy.template.

File Structure

The Media Analysis Solution consists of a demo website, an analysis orchestration layer, a search and storage layer, and an API layer.

  • The demo website is a React application that leverages AWS Amplify to interact with Amazon S3, Amazon API Gateway, and Amazon Cognito.
  • The analysis orchestration layer is an AWS Step Functions state machine that coordinates metadata extraction from Amazon AI services.
  • The search and storage layer uses Amazon Elasticsearch to index extracted metadata and handle search requests.
  • The API layer handles requests for details of media files.
  • The microservices are deployed to a serverless environment in AWS Lambda.
|-deployment/
  |-buildspecs/                             [ solutions builder pipeline build specifications ]
  |-build-s3-dist.sh                        [ shell script for packaging distribution assets ]
  |-run-unit-tests.sh                       [ shell script for executing unit tests ]
  |-media-analysis-deploy.yaml              [ solution CloudFormation deployment template ]
  |-media-analysis-api-stack.yaml           [ solution CloudFormation template for deploying API services ]
  |-media-analysis-storage-stack.yaml       [ solution CloudFormation template for deploying storage services ]
  |-media-analysis-state-machine-stack.yaml [ solution CloudFormation template for deploying state machine ]
|-source/
  |-analysis/                               [ microservices for orchestrating media analysis ]
    |-lib/
      |-collection/                         [ microservice for indexing a new face in a Amazon Rekognition collection ]
      |-comprehend/                         [ microservice for orchestrating natural language comprehension tasks ]
      |-elasticsearch/                      [ microservice for indexing extracted metadata in Amazon Elasticsearch cluster ]
      |-image/                              [ microservice for orchestrating image analysis ]
      |-metricsHelper/                      [ microservice for capturing anonymous metrics pertinent for feedback on the solution ]
      |-steps/                              [ microservice for starting the state machine ]
      |-transcribe/                         [ microservice for orchestrating audio transcription ]
      |-upload/                             [ microservice for uploading metadata to Amazon S3 ]
      |-video/                              [ microservice for orchestrating video analysis ]
    |-index.js
    |-package.json
  |-api/                                    [ microservice for handling requests from Amazon API Gateway ]
    |-lib/
      |-index.js                            [ injection point for microservice ]
      |-details.js                          [ returns details for a requested media file ]
      |-lookup.js                           [ returns metadata for a requested media file ]
      |-search.js                           [ performs a search on Amazon Elasticsearch cluster ]
      |-status.js                           [ returns status of media analysis state machine ]
      |-[service unit tests]
    |-index.js
    |-package.json
  |-helper/                                 [ AWS CloudFormation custom resource for aiding the deployment of the solution ]
    |-lib/
      |-index.js                            [ injection point for microservice ]
      |-esHelper.js                         [ helper for interacting with Amazon Elasticsearch cluster ]
      |-metricsHelper.js                    [ helper for capturing anonymous metrics pertinent for feedback on the solution ]
      |-s3helper.js                         [ helper for interacting with Amazon S3 ]
    |-index.js
    |-package.json
  |-web_site/                               [ ReactJS demo website for the solution ]
    |-public/
    |-src/
      |-components/
      |-img/
      |-styles/
    |-package.json

Each microservice in analysis/lib/ follows the structure of:

|-service-name/
  |-index.js [injection point for microservice]
  |-[service-specific code]
  |-[service-name].js

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

media-analysis-solution's People

Contributors

aassadza avatar georgebearden avatar hyandell avatar shsenior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

media-analysis-solution's Issues

Analysis video failed

We are using Media Analysis Solution and we got a problem. We took your standard solution as a base for our backend architecture. We wrote our our frontend. We have a problem connected to your backend architecture - video analysis breaks for unknown reasons. The size of the video that breaks the video is around ~5GB. Sometimes a smaller video breaks analysis as well.
Analysis breaks as well if you upload several videos from the same account (6 and more files of 2-3 GB each .mp4 format).
Unfortunately, we can't say what the problem is because we can't see anything in the logs. Nothing to see in the service "stepFunctions" that are used as "StateMachine" in this mechanics. Nothing to see in the "Cloud Watch" (screenshots are attached, Screen_1-9 is a "StepFunction", LogsSample examples from Cloud Watch). We need your help to solve this.
To replicate the error, you will need your template (links to the solution and GitHub are below) and remove the upload limitation of 100mb on the frontend and upload the file we've tested with here with the remaining screenshots:
https://www.dropbox.com/sh/kztynnlh6jbcnvm/AAA_L39Stug_9Z88Js7gtf76a?dl=0

Attached you will find the Logs from Functions from arn:aws:lambda:us-east-2:804662430691:function:FrontV11-MediaAnalysisFunction-1RDGN0SCSF6T6 : https://drive.google.com/file/d/1vintzR3mZ_7FjIkEeIEQP9mYWFm3X9nq/view?usp=sharing
Unfortunately, the file is too big to be attached here.

Attachments
image

image

image

image

image

Transcription results are not displaying

The solution used to work before but for some reason, I get javascript errors if you look at the source in developer tools on chrome.

Uncaught TypeError: Cannot read property 'type' of undefined
at e.setFieldValue (onloadwff.js:71)
at HTMLFormElement.formKeydownListener (onloadwff.js:71)
DOMException: Failed to execute 'querySelector' on 'Document': '2013-d35a-446e-b180-b62c7ef7f971' is not a valid selector.

Transcription may fail on certain files with multi-channel audio

We're using the Media Analysis Solution in a project we're working on, and we noted that some multi-channel audio files will fail to transcribe with the current setup. After speaking to AWS support, they determined that channel identification needed to be turned on in the request to AWS Transcribe. This should probably be on by default.

Unable to view results

After uploading a video for analysis and waiting for it to complete. I go to the browse page and then click on the video to view results. The page shows up blank, nothing is there.

Looking through the console I notice this issue.
DOMException: Failed to execute 'querySelector' on 'Document': '60-degrees-904c3cff-43c5-4fe2-bf50-d7240fa70194' is not a valid selector.

Anyone else facing the same issue ?

I'm following this tutorial: https://s3.amazonaws.com/mae303/MediaAnalysisWorkshop.pdf

How can i add text-rekognition.

I want to add text rekognition. In a few steps how can i do it?. just with lambda and steps or i need to change another service?

Manual S3 upload

I've deployed this solution in my AWS account and using the UI it is working fine, however I need to be able to upload files greater than 100mb in size which is a limitation of the console.

Note that if you want to upload a file over 100 MB, you will need to do so directly in the media analysis Amazon S3 bucket that was created as part of the AWS CloudFormation template. This 100 MB limit only occurs when using the demo console.

I've found the bucket created and from looking at the Lambda code it looks like MediaAnalysis-MediaAnalysisFunction is triggered when a file is added to the bucket in the /private directory - however when I've uploaded a file to this location the Lambda is triggered as expected but nothing appears to happen.

Is there a problem with manually uploading files to the S3 bucket or am I just uploading to the wrong location. Thanks for any help / pointers.

Bug Report: Transcription result disappear instantly - Can't view results

Transcription result disappears from the screen after briefly (1 sec ) being displayed.
Tested the frontend both on Chrome and Safari.
Same results with the code downloaded as of Sep 13.
Chrome: Error: backend.js
Failed to load resource: the server responded with a status of 400 ()
react-dom.production.min.js:164 DOMException: Failed to execute 'querySelector' on 'Document': '-4500-0f6ba24f-5f63-4f39-b3ec-xxxxxx' is not a valid selector.
at m (https://xxxx.cloudfront.net/static/js/main.bbd56237.js:1:49498)
at t.value (https://xxxx.cloudfront.net/static/js/main.bbd56237.js:1:109338)
at commitLifeCycles (https://xxxxxx.cloudfront.net/static/js/main.bbd56237.js:1:542425)
at t (https://xxxxx.cloudfront.net/static/js/main.bbd56237.js:1:546002)
at w (https://xxxx.cloudfront.net/static/js/main.bbd56237.js:1:551484)
at E (https://xxxxx.cloudfront.net/static/js/main.bbd56237.js:1:551185)
at h (https://xxxx.cloudfront.net/static/js/main.bbd56237.js:1:550313)
at d (https://xxxx.cloudfront.net/static/js/main.bbd56237.js:1:549703)
at Object.enqueueSetState (https://xxxxxxx.cloudfront.net/static/js/main.bbd56237.js:1:524228)
at t.o.setState (https://xxxxx.cloudfront.net/static/js/main.bbd56237.js:1:503510)

Any idea what the issue is? It used to work fine before July 2019.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.