Skip to content

Instantly share code, notes, and snippets.

View mrtj's full-sized avatar

Janos Tolgyesi mrtj

View GitHub Profile
{
"name": "interface",
"category": "business_logic",
"asset": "",
"inputs": [
{
"name": "video_in",
"type": "media"
},
{
FROM public.ecr.aws/panorama/panorama-application
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir opencv-python numpy
COPY src /panorama
{
"mlModelDescriptor": {
"envelopeVersion": "2021-01-01",
"framework": "PYTORCH",
"inputs": [
{
"name": "images",
"shape": [1, 3, 640, 640]
}
]
{
"nodePackage": {
...
"interfaces": [
{
"name": "interface",
"category": "ml_model",
"asset": "yolox_s_asset",
...
}
{
"name": "model_node",
"interface": "<AWS_ACCOUNT_ID>::yolox_s.interface",
"overridable": false,
"launch": "onAppStart"
}
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')
panorama-cli add-raw-model \
--model-asset-name yolox_s_asset \
--model-local-path [model_archive_path]/yolox_s_torchscript.tar.gz \
--descriptor-path packages/${AWS_ACCOUNT_ID}-yolox_s-1.0/descriptor.json \
--packages-path packages/${AWS_ACCOUNT_ID}-yolox_s-1.0
"edges": [
{
"producer": "camera_node.video_out",
"consumer": "code_node.video_in"
},
{
"producer": "code_node.video_out",
"consumer": "display_node.video_in"
},
{
{
"name": "detection_threshold",
"interface": "float32",
"value": 20.0,
"overridable": true,
"decorator": {
"title": "Threshold",
"description": "The minimum confidence percentage for a positive classification."
}
}
{
"name": "code_node",
"interface": "123456789012::application_logic.interface"
},
{
"name": "model_node",
"interface": "123456789012::yolox_s.interface"
}
@mrtj
mrtj / kinetics_actions.sh
Last active July 9, 2021 07:05
Search for a given action in the Kinetics human activity dataset
#!/usr/bin/env bash
cat train.csv | sed 's/ /_/g' | sed 's/,/ /g' | awk '{print $1}' | grep "$1" | sort | uniq