To implement YoloV7 on a NVIDIA Jetson Nano B01 running Ubuntu 20.04 with an Intel Realsense D435 camera
The steps taken are taken in a specific way of my choosing, however in some instances the choice for the software used may differ. In my case I will be doing this on my personal PC running Ubuntu 22.04.
1.Wipe micro sd card of all existing data.
2.Download and install the OS.
3.Adapt the downloaded repositories.
4.Start NVIDA Jetson Naon.
5.Update and upgrade the system packages with apt-get.
6.Install PyTorch, OpenCV, and other required packages using pip.
7.Download the YOLOv7 repository by Ultralytics LLC.
8.Download the weights for YOLOv7.
9.Connect the Realsense D435 camera to the Jetson Nano via USB.
10.Run the object detection using YOLOv7 and Realsense D435 camera by executing a command in the terminal.
11.The output video stream will display the detected objects along with the corresponding bounding boxes, labels, and orientation angles.
12.Done
Use your OS disk manager to wipe the exiscting data and format it respectively.
As seen below will be formatting it for use in all systems.
In our case we will be using Ubuntu 20.04 for Jetson Nano.
May be accessed at: https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image
Please download and extract the image file.
We will be using balena to flash the micro-SD with Ubuntu. Please download it at https://www.balena.io/etcher/ , select the previously extracted disk image and flash the micro-SD using the program. This will take around 20 minutes.
Please note, there are two designs of the Jetson Nano, the A02 and B01. Ours is the B01 (900-13448-0020-000) as can be seen in the image, as a result we will require further steps as opposed to the A02 that shall skip to step 4.
After completing step 2 and 3 (if applicable), insert the micro-SD card into the Jetson Nano and power it on.
Once the Jetson Nano has booted up, open the terminal and run the following commands:
sudo apt-get update sudo apt-get upgrade
Next, we need to install PyTorch, OpenCV, and other required packages. Run the following commands:
wget https://nvidia.box.com/shared/static/5v5w9tc3wlq3t4w4tuc5lbma9rpa5hfj.whl -O torch-1.9.0-cp36-cp36m-linux_aarch64.whl sudo apt-get install python3-pip libjpeg-dev libpng-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libgtk-3-dev libcanberra-gtk* pip3 install numpy torch-1.9.0-cp36-cp36m-linux_aarch64.whl pip3 install opencv-python-headless==4.5.3.56 pip3 install pyrealsense2
Download the YOLOv7 repository by Ultralytics LLC. Run the following commands:
git clone https://github.com/WongKinYiu/yolov7.git cd yolov7
Download the weights for YOLOv7. Run the following command:
wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt
Connect the Realsense D435 camera to the Jetson Nano via USB.
To run the object detection using YOLOv7 and Realsense D435 camera, execute the following command:
python3 detect.py --source 0 --weights yolov7.pt --conf-thres 0.4 --device 'cuda:0'
To stop the detection, press the q key.
The output video stream will display the detected objects along with the corresponding bounding boxes, labels, and orientation angles.
Congratulations! You have successfully set up.