Currently, AWS Panorama Appliance is generally used by all users.AWS Panorama Appliance is a computer vision (CV) appliance designed to be deployed to the network to analyze images provided by on -premises cameras.
Every week, I read articles on new and innovative computer use cases.We use CVs to confirm that the pallet truck is parked in a specified location to ensure the safety of workers in the warehouse.In addition, there are a few, but for example, some people analyze the flow of customers' walking at retail stores to optimize space and product arrangements, and use them to recognize cats and rats.Some people are.
AWS customers have agreed with the fact that the cloud is virtually infinite access to storage and computing resources, which is the most convenient place to train computer vision models.In the cloud, data scientists can access powerful tools such as Amazon Sagemaker, a wide range of computing resources and frameworks.
However, when analyzing images of one or multiple video feeds, the cloud has received many opinions that it is not a place to do such a workload.There are many reasons for this.The facility where the image is captured is not enough bandwidth to send a video fade to the cloud, or a use case that requires a very low latency, or a network for analysis for analysis.It may not be sent outside.
Re: Invent 2020 announced AWS Panorama Appliance and SDK for these requirements.
AWS Panorama is a mechanical learning appliance and software development kit (SDK), which allows you to capture computer vision into an on -premises camera and predict highly accurate, low latency.With AWS Panorama Appliance, you can automate tasks that had previously required human tests and improve potential problems.For example, using AWS Panorama Appliance, you can evaluate manufacturing quality, identify the bottle neck of industrial processes, and monitor your workplace in an environment where Internet connections are restricted or at all.With this software development kit, camera manufacturers can import the same function directly into his IP camera.
As usual, this blog describes the development and deployment of computer vision applications for AWS Panorama Appliance.This blog demo application uses a machine learning model to recognize the objects in the video frame from the network camera.The application reads the model to his AWS Panorama Appliance, gets an image from the camera, and runs these images through the model.The application overlays on the original video and output it to the connected display.This application uses the library provided by AWS Panorama to operate input / output video streams and models.You do not need low -level programming.
First, let's define some concepts.The following definitions were borrowed from the AWS Panorama document page.
The concept AWS Panorama Appliance is the hardware that runs the application.Use the AWS Panorama Console or AWS SDK to register for appliance, update software, and deploy applications.The software executed on the appliance detects and connects the camera stream, sends a video frame to the application, and displays the video output on the displayed display.
Appliance is an edge device.Instead of sending an image to the AWS cloud for processing, execute the application locally on optimized hardware.This allows you to analyze videos in real time and process results with limited connections.Appliance status reporting, logging of logs, and updating software and acquiring deployments requires only the Internet connection.
The application consists of multiple components called nodes that represent cameras, models, code, or global variables.The node can include only the configuration (input and output) or artifact (model and code).The application node is bundled with a node package that uploads to the S3 access point that AWS Panorama Appliance can access.The application manifest is a configuration file that defines the connection between nodes.
The computer vision model is a machine learning network that has been trained to process images.Computer vision models can perform various tasks, such as classification, detection, segmentation, and tracking.The computer vision model receives the image as input and outputs information about the image or object in the image.
You can import it.
I have grasped the concept with this, so let's actually use it.
The box sent by the opening service team of the AWS Panorama Appliance had an appliance itself (of course).The power cord and he are two Ethernet cables.This box also has a USB key to set the appliance initially.This device is designed to work in an industrial environment.There are two Ethernet ports next to the power connector on the back.There were one SD card reader, one HDMI connector, and two USB ports on the front protected behind the sliding door.There are also power buttons and reset buttons to return the device to the factory shipment.
Settings of the appliance At the first time, I set it according to my network (cable + DHCP, but also support static IP settings) and registered so that it can be safely connected to the AWS account. For that reason, I moved to the AWS Management Console and entered the details of the network settings. A set of configuration files and certificates has been generated. I copied them to the appliance using the provided USB key. His colleague, Martin Beeky, shared the screenshot of this process. The AWS team modified the screen a little based on the feedback received during the preview, but I don't think it is worth the step -by -step process again. Tips from the field: Be sure to use the USB key in the box. Formatting correctly and automatically recognized by appliance (my USB key was not recognized correctly).
Next, I downloaded a sample application from the Panorama GitHub repository and tried it at Test Utility for Panorama, which can be used on this GitHub (test utility is an EC2 instance set to run as a simulator).PTEST UTILITY for Panorama allows you to quickly try sample applications and code using Jupyter notebooks before deploying the appliance.There are also lists that can be deployed to appliance in programs in programs.
The Panorama Command Line Panorama Command line simplifies the operation of the project, importing, packaging, and deploying the AWS Panorama Appliance.According to these steps, you can download and install the Panorama command line.
If you receive an application developed by other people, such as a sample application, you need to replace all application files and directory AWS accounts.Do this with one command.
Panorama-Cli IMPORT-APPLICATION
The structure of the application structure Panorama application is as follows:
├── assets
├── graphs
│ └── example_project
│ └── graph.json
└── packages
├── accountXYZ-model-1.0
│ ├── descriptor.json
│ └── package.json
└── accountXYZ-sample-app-1.0
├── Dockerfile
├── descriptor.json
├── package.json
└── src
└── app.py
Note that the package name has an account number prefix.
When the application is ready, build a container (use a Linux machine with Docker Engine and Docker CLI to avoid using a Docker desktop for MacOS or Windows).
$ panorama-cli build-container \--container-asset-name {container_asset_name} \ --package-path packages/{account_id}-{package_name}-1.0
Precautions about the camera AWS Panorama Appliance have the concept of "abstract camera".The abstract camera sauce is a place holder that can be mapped to an actual camera device during the application deployment.With Test Utility for Panorama, you can map the abstract camera to a video file to perform simple and repetitive tests.
Adding machine learning model AWS Panorama Appliance supports multiple machine learning model frameworks.The model can be trained on Amazon Sagemaker or any other solution.The machine learning model was downloaded from S3 and imported into the project.
panorama-cli add-raw-model \ --model-asset-name {asset_name} \ --model-s3-uri s3://{S3_BUCKET}/{project_name}/{ML_MODEL_FNAME}.tar.gz \ --descriptor-path {descriptor_path}\ --packages-path {package_path}
In the shade, the machine learning model is compiled to optimize the Nvidia Accelerated Linux Arm64 architecture of AWS Panorama Appliance.
アプリケーションのパッケージ化 機械学習モデルとアプリケーションコードがコンテナにパッケージ化されたので、AWS Panorama Appliance のアプリケーションアセットをパッケージ化する準備ができました。
Panorama-Cli Package-Application
This command uploads all application assets to the AWS cloud account, along with all the manifests.
Deploy applications in the application, deploy the application to AWS Panorama Appliance.In the deployment, the application and their settings (such as selecting a camera stream) are copied from his AWS cloud to his AWS Panorama Appliance.You can use Python code (and Boto3 SDK you may already know) to deploy your application in a program.
client = boto3.client('panorama')client.create_application_instance( Name="AWS News Blog Sample Application", Description="An object detection app", ManifestPayload={ 'PayloadData': manifest# <== this is the graph.json file content}, RuntimeRoleArn=role,# <== これは、Cloudwatch などの AWS のサービスを使用するためのアクセス許可をアプリケーションに付与するロールです。 DefaultRuntimeContextDevice=device # <== これは私のデバイス名です。 )
Or you can use the AWS Management Console.
In [Deployed Applications], select Deploy Application.
graphs // graph.json
の内容をコピーしてコンソールに貼り付け、[次へ] を選択します。
Explain your name and options to the application.Select PROCEED TO DEPLOY.
The next step is
The following is an example of the IAM policy.
AWSTemplateFormatVersion: '2010-09-09'説明: AWS Panorama application のリソース。Resources:runtimeRole: Type: AWS::IAM::Role Properties:AssumeRolePolicyDocument:Version: "2012-10-17"Statement: -Effect: AllowPrincipal:Service: - panorama.amazonaws.comAction:- sts:AssumeRolePolicies:- PolicyName: cloudwatch-putmetrics PolicyDocument:Version: 2012-10-17Statement:- Effect: Allow Action: 'cloudwatch:PutMetricData' Resource: '*'Path: /service-role/
The following six screenshots capture this process.
The deployment takes 15-30 minutes, depending on the size of the code, the machine learning model, and the available bandwidth.Eventually, the status changes to a green "run".
When the application is deployed to the AWS Panorama Appliance, the execution starts, continuously analyzing videos, and generates local and high -precision predictions within milliseconds.Connect the HDMI cable to AWS Panorama Appliance and monitor output to see the following:
You can access the Amazon CloudWatch log if you have any problems during the deployment or in the application.Two logstreams are created.One is for AWS Panorama Appliance itself, and the other is for applications.
Price and availability AWS Panorama Appliance can be purchased on the AWS Elemental order page of the AWS console.It can be ordered from the United States, Canada, the UK and the European Union.The appliance itself costs 4,000 USD one -time fee.
8.33 USD/month/Camera feed fee will be charged.
AWS Panorama saves all assets -controlled copies deployed in the AWS Panorama Appliance (including machine learning models and business logic) in the cloud.0 for this storage.10 USD/GB/month will be charged.
If the business logic deployed in AWS Panorama Appliance uses other AWS services, an additional charge may be incurred.For example, if a business logic uploads machine learning forecast to S3 for offline analysis, S3 is charged separately by S3.
AWS Panorama Appliance can be installed anywhere.The appliance is connected to his AWS Panorama services in the eastern United States (northern Virginia), western US (Oregon), Canada (Chubu) or Europe (Ireland) and AWS Region.
Let's build the first computer vision model now.
—SEB
The original text is here.