# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # TensorRT YoloV5s Sample Application
#

# --- 
#
# 1. [Prerequisites](#Prerequisites)
# 1. [Set up](#Set-up)
# 1. [Import model](#Import-model)
# 1. [Write and test app code](#Write-and-test-app-code-in-notebook)
# 1. [Package app](#Package-app)
# 1. [Deploy app to device](#Deploy-app-to-device)

# + [markdown] tags=[]
# # Prerequisites (DO NOT SKIP)
# -

# 1. **PLEASE READ THE [README](README.md) INCLUDE WITH THIS BEFORE YOU START USING THIS NOTEBOOK**

# + [markdown] tags=[]
# # Set up
# -

# Import libraries for use with this notebook environment, you do not need these libraries when you write your application code.

# +
import sys
import os
import time
import json
import boto3
import sagemaker

sys.path.insert( 0, os.path.abspath( "../common/test_utility" ) )
import panorama_test_utility

# + [markdown] tags=[]
# ## Notebook parameters
# Global constants that help the notebook create Panorama resources on your behalf.

# + tags=[]
# application name
app_name = 'lab3'

## package names and node names
code_package_name = 'lab3'
camera_node_name = 'abstract_rtsp_media_source'

# AWS account ID
account_id = boto3.client("sts").get_caller_identity()["Account"]
# -

# ## Set up application
#
# Every application uses the creator's AWS Account ID as the prefix to uniquely identifies the application resources. Running `panorama-cli import-application` replaces the generic account Id with your account Id.

# !cd ./lab3 && panorama-cli import-application

# ## Download Depedencies and Artifacts (One Time Download)

panorama_test_utility.download_artifacts_gpu_sample('lab3', account_id)

# ### Upload application to Panorama for deploying to devices

container_asset_name = 'lab3'

# This step takes some time, depending on your network environment.
# !cd ./lab3 && pwd && panorama-cli package-application

# ### Ready for deploying to a device
#
# Congrats! Your app is now ready to deploy to a device. Next, you can continue in this notebook to deploy the app programmatically or you can go to the Panorama console and deploying using the AWS Console. The console makes it easier to select camera streams and select the devices you want to deploy to. Programmatic deployment is faster to complete and easier to automate.

# ### How to deploy to the device?

# The [README](README.md) file has detailed instructions on how to deploy. Please go to the deployment section of the README file and follow along the instructions

StarcoderdataJupyterScriptsDedupFiltered