[PYTHON] Object detection using Jetson Nano (YOLOv3)-(1) Jetson Nano settings-

Introduction

I tried to detect an object with YOLO v3 using Jetson Nano with a colleague of the company.

① [Basic] Jetson Nano settings ② [Basic] Execution of object detection YOLO v3 on Jetson Nano ③ [Development] Create and execute an original model

This time, it will be (1) Jetson Nano settings. I will also paste the link of what I actually purchased, so please refer to it.

1. What to prepare

--NVIDIA Jetson nano developer kit --Wifi wireless LAN slave unit
→ Required if using wireless LAN. I bought this.
 https://www.amazon.co.jp/TP-Link-WIFI-%E7%84%A1%E7%B7%9ALAN-%E3%83%87%E3%83%A5%E3%82%A2%E3%83%AB%E3%83%A2%E3%83%BC%E3%83%89%E5%AF%BE%E5%BF%9C%E3%83%A2%E3%83%87%E3%83%AB-TL-WN725N/dp/B008IFXQFU --microSD card
→ Use 64GB --USB camera
→ I bought something for about 1,000 yen on Amazon.
If the resolution is too high, the processing will be heavy, so a low resolution is fine.
 https://www.amazon.co.jp/gp/product/B00GZAF72U/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1 --HDMI cable, monitor with HDMI connection
→ As for the monitor, if the TV can be connected via HDMI, the TV is fine.
--Power adapter
→ USB power supply is also possible, but power will be insufficient if object detection is performed.
A 4A-5V J25 power adapter is required. --USB mouse, USB keyboard

2. Jumper pin setting

A 2.54mm pitch jumper pin must be attached to the J48 header to power from the power adapter. The jumper pin was included in the developer kit. It seems that it may not be included, so if you don't have it, you need to purchase it.

3. Install OS on microSD

Let's install the OS on the microSD using a Windows PC.

Download OS "JetPack"

Download "JetPack" from the NVIDIA official website. Access the JetPack page of NVIDIA on your computer and download the latest OS image from the official website. Select Download the SD Card Image of JETSON NANO DEVELOPER KITS in the image below. The zip file will be downloaded, so let's unzip it. There should be a file with a .img extension. I will use it after this. https://developer.nvidia.com/embedded/jetpack image.png

SD card format

Initialize (format) the microSD card. After downloading and installing the "SD Card Formatter" provided by the SD Association, format it in quick format. https://www.sdcard.org/jp/downloads/formatter/ image.png

Write to SD card

To use the software called balenaEtcher, please install it from the following site. After starting balenaEtcher, click Select image and select the "~ .img" file you downloaded earlier. In Select target, select the SD card. Finally, select Flash! To start writing. It will take some time, so wait patiently. https://www.balena.io/etcher/

4. Jetson Nano initial settings

Insert the microSD card and plug in the power adapter with the Wifi wireless LAN slave unit / keyboard / mouse and HDMI connected to the USB port to turn on the power. After that, let's set according to the displayed contents. As a caveat, select English for language selection. If you use Japanese, the directory will be in Japanese, and you will be annoyed by unnecessary things.

5. Swap settings

The Jetson Nano has 4GB of memory, which is not enough for object detection. Let's create a Swap file to use the microSD as virtual memory. You can create a 4GB Swap file by running the following command.

#Creating a Swap file
sudo dd if=/dev/zero of=/var/swapfile bs=1G count=4 #4GB
sudo mkswap /var/swapfile #Swap file initialization
sudo chmod 600 /var/swapfile #Change file permissions(Only accessible by root user)

You can change the size of the Swap file by changing the value of count.

Also, to mount the Swap file automatically when Jetson Nano starts, open the / etc / fstab file and add the following line at the end. /var/swapfile none swap swap 0 0 Reboot now, or run the following command to activate the Swap file without rebooting.

#Swap file activation
sudo swapon /var/swapfile

You can check the size of the allocated Swap area by executing the free -m command. (Since 2GB of Swap area is allocated in the initial state, it should be 6GB.)

6. Maximize performance

Change the power mode for maximum performance. You can maximize performance by simply doing the following:

sudo nvpmodel -m 0
sudo jetson_clocks

Summary

This completes the Jetson Nano settings. Next time, I will try to execute object detection on Jetson Nano.

References

-[Jetson Nano Super Introduction](https://www.amazon.co.jp/Jason-Nano-%E8%B6%85%E5%85%A5%E9%96%80-%E3%81%8B% E3% 82% 89% E3% 81% 82% E3% 81% 92-ebook / dp / B082SN87QP) -Let's get started! NVIDIA Jetson nano First knowledge and first launch!

Acknowledgments

This content was verified with Mr. Mihara, a colleague of the company. I also checked with my former colleague Choi about the connector. We would like to take this opportunity to thank you.

Recommended Posts

Object detection using Jetson Nano (YOLOv3)-(1) Jetson Nano settings-
Facial expression detection using Yolov5
Logo detection using TensorFlow Object Detection API
Try real-time object recognition using YOLOv2 (TensorFlow)
Put DeepStream SDK Python Binding in Jetson Nano and try object detection
I tried object detection using Python and OpenCV
Let's try real-time object detection using Faster R-CNN
jetson nano setup
[Summary] Object detection model "End-to-End Object Detection with Transformers" using Transformer
Set up Jetson nano
2020/02 Python 3.7 + TensorFlow 2.1 + Keras 2.3.1 + YOLOv3 Object detection with the latest version
General object detection using Google's pre-trained model (via TensorFlow Hub)
[For beginners] I tried using the Tensorflow Object Detection API