### Run Jupyter Lab for Occupancy Heatmap Tutorial Source: https://docs.nvidia.com/mms/text/MDX_People_Heatmap_App Instructions to install and run JupyterLab to access and execute the occupancy heatmap tutorial notebook. This involves changing directories and launching the JupyterLab environment. ```bash jupyter lab ``` -------------------------------- ### Deploy and Manage Metropolis Workflows on Azure Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_Azure This snippet demonstrates how to use the `envbuild.sh` script to install, preview, and uninstall the Metropolis RTLS and SDG applications on Azure. It requires the `envbuild.sh` script and associated configuration files to be present. ```bash # To view available options $ ./envbuild.sh or ./envbuild.sh --help # To preview changes based on config.yml without actually applying the changes (-d flag will do dry run) $ ./envbuild.sh install -c all -d # To install changes showed in preview option based on deploy-template.yml $ ./envbuild.sh install -c all # To make changes only part of deloyment, user can use skip flags(supported skip details in --help options) $ $ ./envbuild.sh install -c all -i (This option will skip the changes targeted for infra related changes using envbuild script, similarly multiple flags can be at the same time) # To uninstall the deployed infra and application $ ./envbuild.sh uninstall -c all ``` -------------------------------- ### Deploy Heatmap App using Docker Compose Source: https://docs.nvidia.com/mms/text/MDX_People_Heatmap_App Command to launch the Heatmap app using Docker Compose. It specifies the compose file and environment file, and ensures a clean build and recreation of services. Dependencies include Docker and the Metropolis Microservices setup. ```bash docker compose -f ./heatmap-app/mdx-heatmap-app.yml --env-file ./foundational/.env up -d --pull always --build --force-recreate ``` -------------------------------- ### Example Sensor Metadata Format for Heatmap Overlay Source: https://docs.nvidia.com/mms/text/MDX_People_Heatmap_App Illustrates the JSON structure for sensor metadata used by the Heatmap Overlay component. Key attributes include version, frame ID, timestamp, sensor ID, and detected objects with their bounding boxes and types. ```json { "version":"5.0", "id":"286045", "@timestamp":"2021-09-02T10:08:59.493Z", "sensorId":"Camera D5", "objects":["10037|1506|801|1620|897|Person"] } ``` -------------------------------- ### List Installation Files Source: https://docs.nvidia.com/mms/text/MDX_APPS_One_Click_AWS_CSP_Setup_Guide Lists the files present in the current directory after downloading the artifact. This helps verify that all necessary components for installation are available, such as README, deployment templates, and scripts. ```bash ls ``` -------------------------------- ### Install VST using Helm Source: https://docs.nvidia.com/mms/text/MDX_Kubernetes_Deployment_rtls This command installs the VST (Video Streaming) Helm chart. VST microservices ingest streams from NVStreamer or can be configured to use live cameras directly. Ensure you use the appropriate configuration file for your setup, including edge-to-cloud deployments. ```bash helm install vst-app https://helm.ngc.nvidia.com/rxczgrvsg8nx/vst-1-0/charts/vst-1.0.30.tgz --username='$oauthtoken' --password= -f application-helm-configs/RTLS/vst-app-with-ingress-values.yaml ``` -------------------------------- ### Download and Deploy Metropolis RTLS Workflow Artifact on AWS Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS This snippet demonstrates downloading the Metropolis RTLS deployment artifact from NGC and unpacking it. It then lists the essential files for infra deployment on AWS. The subsequent commands show how to interact with the `mtmc-app-deploy` script for previewing, installing, and uninstalling the application. ```bash # download the artifact $ ngc registry resource download-version "nfgnkvuikvjm/mdx-v2-0/metropolis-aws-one-click-script:0.0.12" ## Go to Artifact directory $ cd metropolis-aws-one-click-script_v0.0.12/ ##untar deploy script tar file $ tar -xvf metropolis-aws-one-click-script.tar.gz # verify necessary files required for Installing Infra on AWS CSP $ ls deploy-spec deploy-template.yml examples k8s-helm-values LICENSE.md modules mtmc-app-deploy README.md secrets.sh # To view available options bash mtmc-app-deploy # To preview changes based on deploy-template.yml without actually applying the changes bash mtmc-app-deploy preview # To install changes showed in preview option based on deploy-template.yml bash mtmc-app-deploy install # To show results/information about the project installed bash mtmc-app-deploy show-results # To uninstall the deployed infra and application bash mtmc-app-deploy uninstall ``` -------------------------------- ### Download and Extract Deployment Artifact Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_Azure This snippet shows how to download the Metropolis Azure NV one-click script from NGC and extract the deployment artifacts. It requires the NGC CLI to be installed and configured. ```bash # download the artifact $ ngc registry resource download-version nfgnkvuikvjm/mdx-v2-0/metropolis-azure-nv-one-click-script:0.0.1 ## Untar deploy script artifact $ cd metropolis-azure-nv-one-click-script_v0.0.1/ $ tar -xvf deploy-mdx-azure-cns.tar.gz # verify necessary files required for Installing Infra on Azure CSP $ ls deploy-mdx-azure-cns.tar.gz dist $ cd dist $ ls ansible-requirements.yml config-files deploy-template.yml envbuild.sh modules README.md cns config.yml envaccess.sh iac-ref playbooks setup-system.sh $ ``` -------------------------------- ### Install Docker Engine (Ubuntu) Source: https://docs.nvidia.com/mms/text/MDX_Download_install This command installs the Docker Engine, its command-line interface, containerd, and related plugins on Ubuntu. It ensures that the necessary components for running Docker containers are available on the system. ```bash sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` -------------------------------- ### Install VST Application using Helm Source: https://docs.nvidia.com/mms/text/MDX_Kubernetes_Deployment_mtmc Installs the VST (Video Streamer) application using a Helm chart. This service feeds NVStreamer sources as simulated live streams and allows direct camera integration via its UI. Configuration can be adjusted using a values file, and an edge-to-cloud setup is supported with a specific values file. ```bash helm install vst-app https://helm.ngc.nvidia.com/rxczgrvsg8nx/vst-1-0/charts/vst-1.0.30.tgz --username='$oauthtoken' --password= -f application-helm-configs/MTMC/vst-app-with-ingress-values.yaml ``` -------------------------------- ### Helm Install Foundational Systems Services Source: https://docs.nvidia.com/mms/text/MDX_Kubernetes_Deployment_prereq_foundational Deploys foundational systems services using Helm, including storage and monitoring. This command installs the 'mdx-foundation-sys-svcs' chart from the specified Helm repository. It requires authentication and an override values file for configuration. The installation includes Nginx ingress controller, various storage classes, and a monitoring stack with Grafana and Prometheus. ```bash helm install mdx-foundation-sys-svcs --wait https://helm.ngc.nvidia.com/nfgnkvuikvjm/mdx-v2-0/charts/mdx-foundation-sys-svcs-v1.3.tgz --username='$oauthtoken' --password=YOUR_API_KEY -f application-helm-configs/foundational-sys/foundational-sys-monitoring-override-values.yaml ``` -------------------------------- ### Install NVStreamer Helm Chart Source: https://docs.nvidia.com/mms/text/media-service/Nvstreamer_Configuration Installs the NVStreamer Helm chart with default configuration parameters. Replace `` and `` with appropriate values. ```bash # with default config parameters helm install ``` -------------------------------- ### Update rtsp_streams.json for Kubernetes Deployments Source: https://docs.nvidia.com/mms/text/MDX_People_Analytics_Configuration This example shows how to manually update the `rtsp_streams.json` configuration within the `application-helm-configs/people-analytics/vst-app-with-ingress-values.yaml` file for Kubernetes deployments. It details how to add new camera stream information for VST. ```yaml rtsp_streams.json: streams: - enabled: true stream_in: rtsp:// <<<==== Change Me Eg: rtsp://vms-vms-svc:30554/live/ name: <<<==== Change Me Eg: Endeavor_Cafeteria # Add more streams here following the same format # - enabled: true # stream_in: rtsp://another_camera_url # name: another_camera_name ``` -------------------------------- ### Install coturn Server for WebRTC Streaming Source: https://docs.nvidia.com/mms/text/media-service/VST_Quickstart_guide This command installs the coturn server, which is a mandatory component for WebRTC streaming, particularly when clients and servers are on different networks. It handles STUN/TURN protocols to facilitate peer-to-peer connections. ```bash sudo apt-get install coturn ``` -------------------------------- ### Deploy and Manage Metropolis Applications Source: https://docs.nvidia.com/mms/text/MDX_APPS_One_Click_Azure_CSP_Setup_Guide Commands to install, update, uninstall, and show results for Metropolis applications and their infrastructure. Use the 'preview' option to see changes before applying them. Exercise caution with 'install' and 'uninstall'. ```bash # To view available options bash mdx-apps-deploy # To preview changes based on deploy-template.yml without actually applying the changes bash mdx-apps-deploy preview # To install changes showed in preview option based on deploy-template.yml bash mdx-apps-deploy install # To show results/information about the project installed bash mdx-apps-deploy show-results # To uninstall the deployed infra and application bash mdx-apps-deploy uninstall ``` -------------------------------- ### GET /behavior/pts Source: https://docs.nvidia.com/mms/webapi/open-api/index Gets the start and end PTS of a behavior in milliseconds. ```APIDOC ## GET /behavior/pts ### Description It is used to get the start and end pts of a behavior in milliseconds. This endpoint is used for video files (sensors) that are streamed using nvstreamer. ### Method GET ### Endpoint /behavior/pts ### Parameters #### Query Parameters - **behaviorId** (string) - Required - The ID of the behavior. ### Request Example ```json { "behaviorId": "behavior1" } ``` ### Response #### Success Response (200) - **startPts** (integer) - The start PTS in milliseconds. - **endPts** (integer) - The end PTS in milliseconds. #### Response Example ```json { "startPts": 123456, "endPts": 789012 } ``` ``` -------------------------------- ### Deploy Template Configuration (YAML) Source: https://docs.nvidia.com/mms/text/MDX_APPS_One_Click_GCP_CSP_Setup_Guide The deploy-template.yml file is a crucial configuration file for setting up the project's infrastructure and environment on GCP CSP. It allows for defining multiple environments and infrastructures within a single project, driving the installation of infrastructure and applications. ```yaml # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NvidiaProprietary # # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual # property and proprietary rights in and to this material, related # documentation and any modifications thereto. Any use, reproduction, # disclosure or distribution of this material and related documentation # without an express license agreement from NVIDIA CORPORATION or # its affiliates is strictly prohibited. ``` -------------------------------- ### Get Behavior Start and End Points API Source: https://docs.nvidia.com/mms/webapi/Services_Behavior.js Retrieves the start and end points of a specific behavior based on sensor ID and frame ID. ```APIDOC ## GET /websites/nvidia_mms/behaviors/start_end_points ### Description Retrieves the start and end points of a specific behavior based on sensor ID and frame ID. ### Method GET ### Endpoint /websites/nvidia_mms/behaviors/start_end_points ### Parameters #### Query Parameters - **sensorId** (string) - Required - The ID of the sensor. - **endFrameId** (number) - Required - The frame ID at the end of the behavior. - **behaviorTimeInterval** (number) - Required - The time interval of the behavior. ### Request Example ```json { "sensorId": "abc", "endFrameId": 200, "behaviorTimeInterval": 20 } ``` ### Response #### Success Response (200) - **startPoint** (object) - The start point of the behavior. - **endPoint** (object) - The end point of the behavior. #### Response Example ```json { "startPoint": { "timestamp": "2023-01-12T11:59:50.000Z", "frameId": 180 }, "endPoint": { "timestamp": "2023-01-12T12:00:10.000Z", "frameId": 200 } } ``` ``` -------------------------------- ### Set Up Docker Repository (Ubuntu) Source: https://docs.nvidia.com/mms/text/MDX_Download_install These commands configure the APT repository for Docker on Ubuntu. They involve updating the package list, installing necessary prerequisites, adding Docker's official GPG key, and adding the Docker repository to the system's sources list. ```bash sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update ``` -------------------------------- ### GET /behavior/timestamp Source: https://docs.nvidia.com/mms/webapi/mdxWebApiCore.Services.Behavior Retrieves the start timestamp of a behavior based on the provided input. ```APIDOC ## GET /behavior/timestamp ### Description Returns the start timestamp of a behavior. ### Method GET ### Endpoint /behavior/timestamp ### Parameters #### Query Parameters - **documentDb** (Database) - Required - Database Object - **input** (Object) - Required - Input object. - **sensorId** (string) - Required - Sensor ID. - **objectId** (string) - Required - Object ID. - **timestampWithinBehavior** (string) - Required - Timestamp within the behavior. ### Response #### Success Response (200) - **timestamp** (string) - The start timestamp of the behavior. #### Response Example { "timestamp": "2023-01-12T14:20:10.000Z" } ``` -------------------------------- ### Sample Bucket Details Output Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS_Appendix This output provides details about S3 buckets and application infrastructure after a successful deployment. It includes bucket names, private IP addresses of application instances, and ALB DNS names. ```hcl Outputs: S3_Bucket_details = { "" = "" } app_infra = { "" = { "private_ips" = [ "", ] } } app_infra = { "" = { alb_dns_name = } } bastion_infra = { "" = { "private_ip" = "" "public_ip" = "" } } coturn_infra = { "> /mnt/backup-files/config.json { "NGC_CLI_API_KEY": "", "s3_sdg_data_path": "", "s3_sdg_calibration_path": "", "s3_sdg_image_path": "", "local_data_path": "/home/ubuntu/sdg-s3-downloaded-data", "nvstreamer_chart_url": "https://helm.ngc.nvidia.com/rxczgrvsg8nx/vst-1-0/charts/nvstreamer-0.2.32.tgz", "vst_chart_url": "https://helm.ngc.nvidia.com/rxczgrvsg8nx/vst-1-0/charts/vst-1.0.30.tgz", "ds_chart_url": "https://helm.ngc.nvidia.com/nfgnkvuikvjm/mdx-v2-0/charts/mdx-wdm-ds-app-0.0.33.tgz" } EOF ``` -------------------------------- ### Get Behavior Start and End Points - JavaScript Source: https://docs.nvidia.com/mms/webapi/Services_Behavior.js Fetches the start and end frame IDs for a specific behavior associated with a sensor. This function requires a database object and specific input parameters including sensorId, endFrameId, and behaviorTimeInterval. It returns a promise that resolves to an object containing the behavior's start and end points. ```javascript const mdx = require("@nvidia-mdx/web-api-core"); const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap); let input = {sensorId: "abc", endFrameId: 200, behaviorTimeInterval: 20}; ``` -------------------------------- ### POST /stream/start Source: https://docs.nvidia.com/mms/mms_doc/mms Start webrtc streaming. ```APIDOC ## POST /stream/start ### Description Initiates a new WebRTC streaming session. ### Method POST ### Endpoint /stream/start ### Parameters #### Request Body - **peerid** (string) - Required - The ID of the peer for the stream. - **sensorId** (string) - Required - The ID of the sensor to stream from. - **options** (object) - Required - Configuration options for the stream. - **codec** (string) - Optional - The codec to use for streaming. - **bitrate** (integer) - Optional - The bitrate for the stream in kbps. - **resolution** (string) - Optional - The resolution of the stream (e.g., "1920x1080"). - **sessionDescription** (object) - Required - The session description for the WebRTC connection. - **type** (string) - Required - The type of session description (e.g., "offer"). - **sdp** (string) - Required - The Session Description Protocol payload. - **startTime** (string) - Optional - The start time for the stream in ISO 8601 format. - **endTime** (string) - Optional - The end time for the stream in ISO 8601 format. ### Request Example ```json { "peerid": "0.8595207664173294", "sensorId": "0b6b62ea-b49a-49dc-906a-0010be31b7d7", "options": { "codec": "VP8", "bitrate": 2000, "resolution": "1280x720" }, "sessionDescription": { "type": "offer", "sdp": "v=0\r\no=- 123456789 123456789 IN IP4 127.0.0.1\r\ns=MyStream\r\nt=0 0\r\n..." }, "startTime": "2023-10-27T10:00:00Z", "endTime": "2023-10-27T11:00:00Z" } ``` ### Response #### Success Response (200) - **boolean** - Indicates if the operation was successful. #### Response Example ```json true ``` ``` -------------------------------- ### Get Behavior Start Timestamp (JavaScript) Source: https://docs.nvidia.com/mms/webapi/Services_Behavior.js Retrieves the start timestamp of a behavior based on sensor ID, object ID, and a timestamp within the behavior. It validates the input and uses Elasticsearch to query for the behavior's start time, returning null if no matching behavior is found. It requires the Database object and input parameters. ```javascript async getTimestampOfBehavior(e,r){let t=Validator.validateJsonSchema(r,{type:"object",additionalProperties:{not:!0,errorMessage:"Invalid additional Input ${0#}."},properties:{sensorId:{type:"string",minLength:1,errorMessage:{minLength:"sensorId should have atleast 1 character."}},objectId:{type:"string",minLength:1,errorMessage:{minLength:"objectId should have atleast 1 character."}},timestampWithinBehavior:{type:"string"}},required:["sensorId","objectId","timestampWithinBehavior"],errorMessage:{required:"Input should have required properties 'sensorId', 'objectId' and 'timestampWithinBehavior'."}});if(!t.valid)throw new BadRequestError(t.reason);if(!Validator.isValidISOTimestamp(r.timestampWithinBehavior))throw new InvalidInputError("Invalid timestampWithinBehavior.");let a=null;if("Elasticsearch"===e.getName())return a=await this.#a(e,r),a;throw new InternalServerError(`Invalid database: ${e.getName()}.`)} ``` -------------------------------- ### Get Similar Behaviors Based on Example using MTMC Source: https://docs.nvidia.com/mms/webapi/mdxWebApiCore.Services.MTMC Retrieves scored behaviors similar to a given example. It requires a document database and a vector database, and takes an input object with details about the example behavior. Optional parameters allow filtering by time range, number of matches, and match score threshold. ```javascript const mdx = require("@nvidia-mdx/web-api-core"); const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap); const milvus = new mdx.Utils.Milvus({url: "milvus-url"},databaseConfigMap); let input = {sensorIdOfExample: "abc", objectIdOfExample: "120", timestampOfExample: "2023-01-12T12:02:00.000Z"}; let mtmc = new mdx.Services.MTMC(); let behaviors = await mtmc.getSimilarBehaviorsBasedOnExample(elastic, milvus, input); ``` -------------------------------- ### Kafka Topic Configuration Example Source: https://docs.nvidia.com/mms/BehaviorAnalytics/com/nvidia/mdx/core/util/index Demonstrates how to configure Kafka topics within the Nvidia MMS SDK using default prefixes and allows for user overrides. This is crucial for routing analytics data to the correct Kafka topics. ```scala alertsTopic = mdx-alerts framesTopic = mdx-frames behaviorTopic = mdx-behavior behaviorPlusTopic = mdx-behavior-plus tripwireTopic = mdx-tripwire User can always override the above in the configuration ``` -------------------------------- ### Get Behavior Timestamp - JavaScript Source: https://docs.nvidia.com/mms/webapi/mdxWebApiCore.Services.Behavior Retrieves the start timestamp of a behavior using the Behavior service. It requires a database object and an input object containing sensorId, objectId, and timestampWithinBehavior. The function returns a promise that resolves to the behavior's start timestamp. ```javascript const mdx = require("@nvidia-mdx/web-api-core"); const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap); let input = {sensorId: "abc", objectId: "200", timestampWithinBehavior: "2023-01-12T14:20:10.000Z"}; let behaviorObject = new mdx.Services.Behavior(); let timestamp = await behaviorObject.getTimestampOfBehavior(elastic,input); ``` -------------------------------- ### Get Default Instance of GetPersistentSegmentInfoResponse Source: https://docs.nvidia.com/mms/BehaviorAnalytics/io/milvus/grpc/milvus/GetPersistentSegmentInfoResponse%24 Retrieves the default, pre-initialized instance of GetPersistentSegmentInfoResponse. This is often used as a starting point or for comparison purposes. ```Scala lazy val defaultInstance: GetPersistentSegmentInfoResponse ``` -------------------------------- ### Initialize ConfigUtil with a Configuration File Source: https://docs.nvidia.com/mms/BehaviorLearning/mdx.utils.config_util This snippet shows how to instantiate the ConfigUtil class, optionally providing a path to a JSON configuration file. If no file is provided, default settings are loaded. This sets up the configuration object for subsequent operations. ```python config_util = ConfigUtil("path/to/config/file.json") ``` -------------------------------- ### TrajectoryEBase - Get Head Coordinate Source: https://docs.nvidia.com/mms/BehaviorAnalytics/com/nvidia/mdx/core/schema/trajectory/TrajectoryE Retrieves the first coordinate point of the trajectory. This is essential for accessing the starting position of the tracked path. ```Scala def head: Coordinate // head of trajectory ``` -------------------------------- ### Upload Data to S3 Bucket using Python Script Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS This command utilizes a Python script to upload generated data, such as videos or calibration artifacts, to a specified S3 bucket. It requires the script path, the source directory or file, the destination path in the bucket, and the bucket name. It can also specify the file format. ```bash ./python.sh /uploads/post_processing.py -sd /isaac-sim/ReplicatorResult/ -f mp4 -b -dd sdg_data ``` ```bash ./python.sh /uploads/post_processing.py -sf /uploads/calibration.json -df calibration_artifacts/calibration.json -b s3_bucket_name ``` ```bash ./python.sh /uploads/post_processing.py -sf /uploads/Top.png -df calibration_artifacts/Top.png -b s3_bucket_name ``` ```bash ./python.sh /uploads/post_processing.py -sf /uploads/imageMetadata.json -df calibration_artifacts/imageMetadata.json -b s3_bucket_name ``` -------------------------------- ### Behavior Pts API Source: https://docs.nvidia.com/mms/text/MDX_Analytics_And_Tracking_API Gets the start and end presentation time (PTS) for a behavior based on the video source, mainly for NVStreamer sources. ```APIDOC ## GET /api/behavior/pts ### Description This endpoint is used to get a behavior’s start and end presentation time based on the video source. This is mainly used for NVStreamer sources. ### Method GET ### Endpoint /api/behavior/pts ### Parameters #### Query Parameters - **behavior_id** (string) - Required - The ID of the behavior. - **source_id** (string) - Required - The ID of the NVStreamer source. ### Request Example ```json { "example": "/api/behavior/pts?behavior_id=bhv_002&source_id=nvstreamer_2" } ``` ### Response #### Success Response (200) - **start_pts** (long) - The presentation timestamp at the start of the behavior. - **end_pts** (long) - The presentation timestamp at the end of the behavior. #### Response Example ```json { "start_pts": 1234567890123, "end_pts": 1234587890123 } ``` ``` -------------------------------- ### Get Default Bbox Instance (Scala) Source: https://docs.nvidia.com/mms/BehaviorAnalytics/nv/schema/Bbox%24 Retrieves the default instance of a Bbox object. This is often a pre-configured or empty Bbox used as a starting point or for default values. ```scala lazy val defaultInstance: Bbox ``` -------------------------------- ### Create Configuration for NVStreamer Data Load (Shell) Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_Azure This snippet demonstrates how to create a JSON configuration file for loading generated data into the NVStreamer microservice. It requires specifying NGC API key, blob mount folder names for video and calibration data, and URLs for NVStreamer, VST, and DS charts. ```shell $ cat << EOF >> /mnt/sdg-data/config.json { "NGC_CLI_API_KEY": "", "blob_mount_sdg_data_folder": "", "blob_mount_sdg_calibration_folder": "", "nvstreamer_chart_url": "https://helm.ngc.nvidia.com/rxczgrvsg8nx/vst-1-0/charts/nvstreamer-0.2.32.tgz", "vst_chart_url": "https://helm.ngc.nvidia.com/rxczgrvsg8nx/vst-1-0/charts/vst-1.0.30.tgz", "ds_chart_url": "https://helm.ngc.nvidia.com/nfgnkvuikvjm/mdx-v2-0/charts/mdx-wdm-ds-app-0.0.33.tgz" } EOF ``` -------------------------------- ### SDG Deployment Verification Output Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS_Appendix This output details the verification of an SDG deployment on AWS. It includes cloud provider information, IP addresses, VM resource IDs, and instructions for connecting to the deployed Isaac Sim instance via SSH, VNC, and NoMachine. ```bash Outputs: cloud = "aws" isaac_ip = "" isaac_vm_id = "" ovami_ip = "NA" ssh_key = ************************************************* * Isaac Sim is deployed at * ************************************************* * To connect to Isaac Sim via SSH: ssh -i state//key.pem -o StrictHostKeyChecking=no ubuntu@ * To connect to Isaac Sim via noVNC: 1. Open http://:6080/vnc.html?host=&port=6080 in your browser. 2. Click "Connect" and use password "" * To connect to Isaac Sim via NoMachine: 0. Download NoMachine client at https://downloads.nomachine.com/, install and launch it. 1. Click "Add" button. 2. Enter Host: "". 3. In "Configuration" > "Use key-based authentication with a key you provide", select file "state/sdg-test-isaac-1/key.pem". 4. Click "Connect" button. 5. Enter "ubuntu" as a username when prompted. ``` -------------------------------- ### Scala: Get Default Instance of GetImportStateResponse Source: https://docs.nvidia.com/mms/BehaviorAnalytics/io/milvus/grpc/milvus/GetImportStateResponse%24 Provides the default, uninitialized instance of GetImportStateResponse. This is often used as a starting point or a placeholder. It is a lazy val defined within the companion object. ```scala lazy val defaultInstance: GetImportStateResponse ``` -------------------------------- ### SDG Deploy Template Parameters Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS_Appendix This section explains the parameters used in the SDG deploy configuration file. It details the purpose, type, and optionality of each parameter, crucial for setting up AWS infrastructure and deploying applications like Isaac Sim. ```text deployment-name | string | | Deployment name for SDG App. region | string | | AWS Region to deploy the infrastructure required for sdg. isaac | | | To Deploy/configure Isaac Sim in provisioned VM so as to run simulation and generate new data. Defaults to “yes” isaac-instance-type | string | yes | AWS VM type to use for SDG App. By default it is configured to use 4xA10 GPU VM - g5.12xlarge. isaac-image | string | yes | Docker Image to use for isaacsim deployment. We will use latest released docker supported for simulation workflow. isaaclab | | | To Deploy/configure Isaac Sim Lab in provisioned VM so as to run simulation and generate new data. Defaults to “no” ngc-api-key | string | | NGC API Key to pull docker from NGC team - mdx-v2.0 aws-access-key-id | string | | AWS Access Key ID for accessing and provisiong infra in AWS CSP. aws-secret-access-key | string | | AWS Secret Key ID for authenticating and provisiong infra in AWS CSP. ``` -------------------------------- ### Download Sample Input Data using NGC CLI Source: https://docs.nvidia.com/mms/text/MDX_Kubernetes_Deployment_prereq_foundational Downloads the sample input data package from the NVIDIA NGC registry using the NGC CLI tool. Similar to the deployment package, it requires organization, team, resource name, and a version tag. The output is a tarball containing sample data. ```bash $ ngc registry resource download-version "nfgnkvuikvjm/mdx-v2-0/metropolis-apps-sample-input-data:-" ``` -------------------------------- ### Get Default Instance of SearchResultData Source: https://docs.nvidia.com/mms/BehaviorAnalytics/io/milvus/grpc/schema/SearchResultData%24 Retrieves the default instance of SearchResultData. This is often a pre-initialized object used as a starting point or for comparison. It is a lazy val defined in the SearchResultData companion object. ```scala lazy val defaultInstance: SearchResultData ``` -------------------------------- ### Generate Videos from Images using Python Script Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS This command executes a Python script within the Isaac Sim container to generate video files from previously generated images. It requires specifying the script path, the output directory for results, and optionally flags for batch processing. ```bash ./python.sh /uploads/post_processing.py -bu -sd /isaac-sim/ReplicatorResult/ ``` -------------------------------- ### Environment Setup for ReID Finetuning (Conda) Source: https://docs.nvidia.com/mms/text/MDX_ReIdentificationNet This code snippet demonstrates how to set up a Conda environment for fine-tuning ReIdentificationNet models. It creates a new environment named 'reid_finetuning' with Python 3.11 and installs jupyterlab. ```shell conda create -n reid_finetuning python=3.11 conda activate reid_finetuning conda install jupyterlab ``` -------------------------------- ### Run Edge Client Installation Script Source: https://docs.nvidia.com/mms/text/Edge_to_Cloud_Video_Streaming Executes the bash script to install and configure the edge client for connecting to a hosted OpenVPN environment. Ensure the 'profile.ovpn' file is in the current directory. ```bash $ sudo bash ./edgeinstall-openvpn.sh ``` -------------------------------- ### Execute Docker Command in Isaac Sim Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS This command allows users to enter the Isaac Sim Docker container to execute subsequent commands within the simulation environment. It's a prerequisite for running Python scripts and deployment commands inside the container. ```bash docker exec -it isaacsim bash ``` -------------------------------- ### Get Mutable Sensor Configuration Source: https://docs.nvidia.com/mms/BehaviorAnalytics/com/nvidia/mdx/core/transform/pb/Calibration%24 A mutable map holding string key-value pairs for sensor configuration. This is noted to be used as a singleton within Spark executors for performance, and requires specific setup outside Spark. ```Scala var config: Map[String, String] // for performance reason, while running in spark, singleton Calibration is used in a given executor // ... // while running outside of spark the below config needs to be set before running any operations ``` -------------------------------- ### Configure Retail Item Detection Model Deployment Source: https://docs.nvidia.com/mms/text/FSL_Retail_Object_Detection This configuration block details the parameters for deploying a retail item detection model. It includes settings for GPU usage, model scaling, color format, model and label file paths, network input order, inference dimensions, aspect ratio maintenance, batch size, network mode (FP32, INT8, FP16), number of detected classes, interval, cluster mode, output blob names, custom parsing function, and custom library path. It also specifies parameters for Non-Maximum Suppression (NMS) clustering. ```yaml property: gpu-id: 0 net-scale-factor: 1 offsets: 0;0;0 model-color-format: 0 tlt-model-key: nvidia_tlt tlt-encoded-model: ../../models/retailDetector/retailDetector_100.etlt model-engine-file: ../../models/retailDetector/retailDetector_100.etlt_b1_gpu0_fp16.engine labelfile-path: ../../models/retailDetector/retailDetector_100_labels.txt network-input-order: 1 infer-dims: 3;416;416 maintain-aspect-ratio: 1 batch-size: 1 ## 0=FP32, 1=INT8, 2=FP16 mode network-mode: 2 num-detected-classes: 100 interval: 0 cluster-mode: 3 output-blob-names: num_detections;detection_boxes;detection_scores;detection_classes parse-bbox-func-name: NvDsInferParseCustomEfficientDetTAO custom-lib-path: ../../post_processor/libnvds_infercustomparser_tao.so #Use the config params below for NMS clustering mode class-attrs-all: pre-cluster-threshold: 0.5 ``` -------------------------------- ### SDG Deploy Error Workaround Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS_Appendix This snippet demonstrates a workaround for a common SDG deployment error related to existing deployments. It shows how to use the `--existing repair` option when the deployment already exists, allowing for repair or modification instead of immediate abortion. ```bash [Isaac Automator v3.0.0]:/app$ cat sdg-deploy.txt | xargs ./deploy-aws --existing repair * Deploymemnt exists, what would you like to do? See --help for details. (repair, modify, replace, run_ansible) [replace]: Aborted! [Isaac Automator v3.0.0]:/app$ cat sdg-deploy.txt | xargs ./deploy-aws --existing=repair * Deploymemnt exists, what would you like to do? See --help for details. (repair, modify, replace, run_ansible) [replace]: Aborted! ``` -------------------------------- ### Verify Application Cleanup Source: https://docs.nvidia.com/mms/text/MDX_Kubernetes_Deployment_mtmc Confirms that Helm charts and Kubernetes storage resources have been successfully removed. 'helm ls' should show no installed charts, and 'kubectl get pods,pvc,pv' should return no resources, indicating a clean state. ```bash helm ls kubectl get pods,pvc,pv ``` -------------------------------- ### JSON Representation of a Road Segment Source: https://docs.nvidia.com/mms/BehaviorAnalytics/com/nvidia/mdx/core/util/osm/index Provides an example of the JSON structure for a road segment. This format is used for rendering road links on a map and includes traffic flow information. Key fields are 'id', 'direction', 'start', 'end', and 'points'. ```json { "id": "700087309", "direction": "E", "start": { "lat": 42.491827551092825, "lon": -90.72371011354872, "alt": 0.0 }, "end": { "lat": 42.49194191750754, "lon": -90.72048326702006, "alt": 0.0 }, "points": [ { "lat": 42.491827551092825, "lon": -90.72371011354872, "alt": 0.0 }, { "lat": 42.491919379500736, "lon": -90.72269553071325, "alt": 0.0 }, { "lat": 42.49195234832061, "lon": -90.72160718712823, "alt": 0.0 }, { "lat": 42.49194191750754, "lon": -90.72048326702006, "alt": 0.0 } ] } ``` -------------------------------- ### Show Partitions Source: https://docs.nvidia.com/mms/BehaviorAnalytics/com/nvidia/mdx/core/milvus/ServiceClient%24 Retrieves a list of partitions for a collection. ```APIDOC ## GET /showPartitions ### Description Retrieves a list of all partitions for a specified collection. ### Method GET ### Endpoint /showPartitions ### Response #### Success Response (200) - **response** (ShowPartitionsResponse) - Information about the partitions. #### Response Example ```json { "response": {} } ``` ``` -------------------------------- ### Download Metropolis GCP One-Click Script Source: https://docs.nvidia.com/mms/text/MDX_APPS_One_Click_GCP_CSP_Setup_Guide This command downloads the Metropolis GCP one-click deployment script artifact from the NGC registry. It requires the NGC CLI to be set up and specifies the organization and team. After downloading, the user navigates into the extracted directory. ```bash # download the artifact $ ngc registry resource download-version "nfgnkvuikvjm/mdx-v2-0/metropolis-gcp-one-click-script:0.0.5" $ cd metropolis-gcp-one-click-script_v0.0.5/ ``` -------------------------------- ### Generate Image Metadata using Python Script Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS This command runs a Python script to create an image metadata JSON file, which is essential for the RTLS application. It requires the paths to the calibration file and the destination directory for the output metadata file. ```bash ./python.sh /uploads/create_image_metadata.py -c /uploads/calibration.json -d /uploads/ ``` -------------------------------- ### Configure AWS and NGC Secrets with secret.sh Source: https://docs.nvidia.com/mms/text/Multi_Camera_Sim2Deploy_AWS_Appendix This bash script sets environment variables for cloud deployment credentials. It requires replacing placeholder values with actual AWS access keys, SSH public key, NGC API key, and turn server password. Ensure these secrets are handled securely. ```shell #!/bin/bash # SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NvidiaProprietary # # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual # property and proprietary rights in and to this material, related # documentation and any modifications thereto. Any use, reproduction, # disclosure or distribution of this material and related documentation # without an express license agreement from NVIDIA CORPORATION or # its affiliates is strictly prohibited. # # _aws_access_key_id -> AWS access key id to create resources export _aws_access_key_id='' # _aws_secret_access_key -> AWS secret access key to create resources export _aws_secret_access_key='' # _ssh_public_key -> Your public ssh key's content export _ssh_public_key='' # _ngc_api_key -> Your ngc api key value export _ngc_api_key='' # _turnserver_password -> Password for turn server export _turnserver_password='' ``` -------------------------------- ### Check Pod Logs with Kubectl Source: https://docs.nvidia.com/mms/text/MDX_APPS_One_Click_GCP_CSP_Setup_Guide This command allows you to view the logs of a specific Kubernetes pod. The `-f` flag enables live log streaming, which is useful for debugging running or crashing pods. Ensure you have kubectl configured to connect to your Kubernetes cluster. ```bash kubectl logs kubectl logs -f ``` -------------------------------- ### Get Locations of Behaviors - JavaScript Source: https://docs.nvidia.com/mms/webapi/Services_Behavior.js Retrieves the locations for a given set of behaviors specified by their IDs, start, and end timestamps. It validates input parameters and time ranges, then queries Elasticsearch to fetch the behavior data. Returns formatted results or throws an error for invalid databases. ```javascript async getLocationsOfBehaviors(e,r){const t={type:"object",additionalProperties:{not:!0,errorMessage:"Invalid additional Input ${0#}."},properties:{fromTimestamp:{type:"string"},toTimestamp:{type:"string"},behaviorIds:{type:"array",items:{type:"string",minLength:1,errorMessage:{minLength:"Element of behaviorIds array should have atleast 1 character."}},minItems:1,maxItems:Behavior.#t,errorMessage:{minItems:"behaviorIds should have atleast 1 item",maxItems:`behaviorIds can have atmost ${Behavior.#t} items.`}}},required:["fromTimestamp","toTimestamp","behaviorIds"],errorMessage:{required:"Input should have required properties 'behaviorIds', 'fromTimestamp' and 'toTimestamp'."}};let a=Validator.validateJsonSchema(r,t);if(!a.valid)throw new BadRequestError(a.reason);let i=Validator.isValidTimeRange(r.fromTimestamp,r.toTimestamp);if(!i.valid)throw new InvalidInputError(i.reason);let s=new Array;if("Elasticsearch"===e.getName()){let t=await this.#s(e,r);return t.indexAbsent||(s=Elasticsearch.searchResultFormatter(t.body)),{behaviors:s}}throw new InternalServerError(`Invalid database: ${e.getName()}.`)} ``` -------------------------------- ### GET /vst/settings Source: https://docs.nvidia.com/mms/mms_doc/mms Retrieves various VST-specific settings. ```APIDOC ## GET /vst/settings ### Description Retrieves various VST-specific settings. ### Method GET ### Endpoint `/vst/settings` ### Parameters (No parameters) ### Response #### Success Response (200) (Details of VST settings would be described here. The provided text snippet is incomplete for this endpoint's response.) ```