This article explains how to run YOLOv5 on the Jetson Nano, which has several implementations of YOLOv5, but this article explains how to run the original PyTorch implementation of YOLOv5.
YOLOv5 requires python 3.7 or higher, but Jetson Nano has python 3.6 installed by default, and the official PyTorch library is also python 3.6, so these cannot be used.
So, we will introduce the PyTorch library that can be used with python 3.8 with reference to this article.
Actually, the difficult part is the custom PyTorch installation described above. The YOLOv5 installation itself is not particularly difficult.
git clone https://github.com/ultralytics/yolov5.git
cd yolov5
python3.8 -m pip install -r requirements.txt
python3.8 detect.py --source 0
Code language: Bash (bash)
--source
specifies the video source. There are many other options available, so check below for more details.
python3.8 detect.py --help
Code language: Bash (bash)
That’s all.