Darknet YOLOv3 on Jetson Nano

Darknet YOLOv3 on Jetson Nano

We installed Darknet, a neural network framework, on Jetson Nano in order to build an environment to run the object detection model YOLOv3.

Object detection results by YOLOv3 & Tiny YOLOv3

We performed the object detection of the test images of GitHub – udacity/CarND-Vehicle-Detection: Vehicle Detection Project using the built environment.
The left and right images show the object detection results of YOLOv3 and Tiny YOLOv3, respectively.

Setup

Darknet

Darknet is a neural network framework. See Darknet: Open Source Neural Networks in C for more information. The source is published on GitHub – pjreddie/darknet: Convolutional Neural Networks.

This time we used the repository: GitHub – AlexeyAB/darknet: Windows and Linux version of Darknet Yolo v3 & v2 Neural Networks for object detection (Tensor Cores are used).

Create the ~/github directory beforehand and execute the following command.

$ cd ~/github
$ git clone https://github.com/AlexeyAB/darknet
$ cd darknet
$ git checkout darknet_yolo_v3 -b jetson_nano

Change the Makefile in the ~/github/darknet directory as follows:

GPU=1
CUDNN=1
OPENCV=1
ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]

Finally, run make.

$ PATH=/usr/local/cuda/bin:$PATH make -j$(nproc)

YOLOv3 & Tiny YOLOv3

Download the pre-trained weight files of YOLOv3 and Tiny YOLOv3 from YOLO: Real-Time Object Detection to ~/github/darknet directory.

$ cd ~/github/darknet
$ wget https://pjreddie.com/media/files/yolov3.weights
$ wget https://pjreddie.com/media/files/yolov3-tiny.weights

Run the following command to test YOLOv3.

$ cd ~/github/darknet
$ ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

Run the following command to test Tiny YOLOv3.

$ cd ~/github/darknet
$ ./darknet detect cfg/yolov3-tiny.cfg yolov3-tiny.weights data/dog.jpg

Summary

We installed Darknet, a neural network framework, on Jetson Nano in order to build an environment to run the object detection model YOLOv3.