Skip to content

Instantly share code, notes, and snippets.

@mitsudome-r
Last active November 21, 2024 23:44
Show Gist options
  • Save mitsudome-r/b9439e7f87ee0a23aa6ec694b97aef2c to your computer and use it in GitHub Desktop.
Save mitsudome-r/b9439e7f87ee0a23aa6ec694b97aef2c to your computer and use it in GitHub Desktop.
Demo instructions for trt-lightnet

CES 2025 Perception Demo Instructions

Preparation

Git Install

sudo apt update
sudo apt install git

Docker Install

ref: https://docs.docker.com/engine/install/ubuntu/

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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

# Install docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Add user group
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker

Clone TRT-Lightnet Repository

git clone https://github.com/tier4/trt-lightnet

Get Sample Video & Access Token for Container

  • ask Ryohsuke Mitsudome on slack
  • The following instructions assume that you downloaded the following files under /home/nvidia/Downloads folder:
    • token.txt
    • trt-lightnet-test-video.mp4
  • If you downloaded to different place, make sure you replace /home/nvidia/Downloads with the path to the downloaded file. (For example if your user name is not nvidia, you should modify it with your user name)

Run Perception with Only Detection (before scenario)

cat /home/nvidia/Downloads/token.txt | docker login ghcr.io -u mitsudome-r --password-stdin

xhost local:

docker run -it --runtime=nvidia --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw"  -v /home/nvidia/Downloads/trt-lightnet-test-video.mp4:/opt/app/trt-lightnet-test-video.mp4 -e DISPLAY=${DISPLAY} ghcr.io/mitsudome-r/trt-lightnet:before-update

./trt-lightnet --flagfile ../configs/CoMLOps-Reference-Vision-Detection-Model-v0.1.2.txt --precision fp16 --first true --v ../trt-lightnet-test-video.mp4

Run Perception with Detection + Segmentation + Depth (after scenario)

cat /home/nvidia/Downloads/token.txt | docker login ghcr.io -u mitsudome-r --password-stdin

xhost local:

docker run -it --runtime=nvidia --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw"  -v /home/nvidia/Downloads/trt-lightnet-test-video.mp4:/opt/app/trt-lightnet-test-video.mp4 -e DISPLAY=${DISPLAY} ghcr.io/mitsudome-r/trt-lightnet:after-update

./trt-lightnet --flagfile ../configs/CoMLOps-Reference-Vision-Detection-Segmentation-Depth-Model-v0.1.2.txt --precision fp16 --first true --v ../trt-lightnet-test-video.mp4

Troubleshooting

If you do not have internet access

  1. Get the links for the docker images from Ryohsuke Mitsudome on Slack.
  2. Download the following images from Google Drive in different PC which has internet access:
    • trt-lightnet-before-update.tar
    • trt-lightnet-after-update.tar
  3. Copy the downloaded files to your host machine by USB memory stick.
  4. Run the following commands to load the image to the host machine. (Make sure to change the path according to your copied directory)
docker load -i /path/to/trt-lightnet-before-update.tar
docker load -i /path/to/trt-lightnet-after-update.tar
  1. Follow the normal instruction to run perception modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment