Sample applications, scripts, and templates - AWS Panorama

Sample applications, scripts, and templates

The GitHub repository for this guide provides sample applications, scripts, and templates for AWS Panorama devices. Use these samples to learn best practices and automate development workflows.

Sample applications

Sample applications demonstrate use of AWS Panorama features and common computer vision tasks. These sample applications include scripts and templates that automate setup and deployment. With minimal configuration, you can deploy and update applications from the command line.

  • aws-panorama-sample – Basic computer vision with a classification model. Use the AWS SDK for Python (Boto) to upload metrics to CloudWatch, instrument preprocessing and inference methods, and configure logging.

  • debug-serverOpen inbound ports on the device and forward traffic to an application code container. Use multithreading to run application code, an HTTP server, and an HTTP client simultaneously.

  • custom-model – Export models from code and compile with SageMaker Neo to test compatibility with the AWS Panorama Appliance. Build locally in a Python development, in a Docker container, or on an Amazon EC2 instance. Export and compile all built-in application models in Keras for a specific TensorFlow or Python version.

For more sample applications, also visit the aws-panorama-samples repository.

Utility scripts

The scripts in the util-scripts directory manage AWS Panorama resources or automate development workflows.

For usage details, see the README.

AWS CloudFormation templates

Use the AWS CloudFormation templates in the cloudformation-templates directory to create resources for AWS Panorama applications.

  • alarm-application.yml – Create an alarm that monitors an application for errors. If the application instance raises errors or stops running for 5 minutes, the alarm sends a notification email.

  • alarm-device.yml – Create an alarm that monitors a device's connectivity. If the device stops sending metrics for 5 minutes, the alarm sends a notification email.

  • application-role.yml – Create an application role. The role includes permission to send metrics to CloudWatch. Add permissions to the policy statement for other API operations that your application uses.

  • vpc-appliance.yml – Create a VPC with private subnet service access for the AWS Panorama Appliance. To connect the appliance to a VPC, use AWS Direct Connect or AWS Site-to-Site VPN.

  • vpc-endpoint.yml – Create a VPC with private subnet service access to the AWS Panorama service. Resources inside of the VPC can connect to AWS Panorama to monitor and manage AWS Panorama resources without connecting to the internet.

The script in this directory creates AWS CloudFormation stacks. It takes a variable number of arguments. The first argument is the name of the template, and the remaining arguments are overrides for parameters in the template.

For example, the following command creates an application role.

$ ./ application-role

More samples and tools

The aws-panorama-samples repository has more sample applications and useful tools.

  • Applications – Sample applications for various model architectures and use cases.

  • Camera stream validation – Validate camera streams.

  • PanoJupyter – Run JupyterLab on an AWS Panorama Appliance.

  • Sideloading – Update application code without building or deploying an application container.

The AWS community has also developed tools and guidance for AWS Panorama. Check out the following open source projects on GitHub.

  • cookiecutter-panorama – A Cookiecutter template for AWS Panorama applications.

  • backpack – Python modules for accessing runtime environment details, profiling, and additional video output options.