YOLOv8 Object Detection on Jetson Nano
Author:
Darshan Anand
Pre-final Year CSE-AIML Student
Dayananda Sagar University
Email: darshananand004@gmail.com
Installation Steps
-
- Install Jetpack 4.6 on Jetson Nano
Ensure Jetpack 4.6 (L4T 32.6.1) is installed on the Jetson Nano.
- Install Jetpack 4.6 on Jetson Nano
-
- Update and Install Dependencies
Open a terminal and run the following commands:
- Update and Install Dependencies
sudo apt update
sudo apt install -y python3.8 python3.8-venv python3.8-dev python3-pip libopenmpi
dev libomp-dev libopenblas-dev libblas-dev libeigen3-dev libcublas-dev
-
- Clone the YOLOv8 Repository
git clone https://github.com/ultralytics/ultralytics
cd ultralytics
-
- Create and Activate a Python 3.8 Virtual Environment
python3.8 -m venv venv
source venv/bin/activate
-
- Update Python Packages
pip install -U pip wheel gdown
-
- Download and Install Pre-built PyTorch and TorchVision Packages
# PyTorch 1.11.0
gdown https://drive.google.com/uc?id=1hs9HM0XJ2LPFghcn7ZMOs5qu5HexPXwM
# TorchVision 0.12.0
gdown https://drive.google.com/uc?id=1m0d8ruUY8RvCP9eVjZw4Nc8LAwM8yuGV
python3.8 -m pip install torch-*.whl torchvision-*.whl
-
- Install YOLOv8 Python Package
pip install .
-
- Execute Object Detection
yolo task=detect mode=predict model=yolov8n.pt source=0 show=True
yolo task=segment mode=predict model=yolov8n-seg.pt source=0 show=True
Observations and Results
Object Detection Output 1: 480x640 1 person, 170.5ms …
[Image: file-JGLGw584df2vKiawc0BHVC2i not found]
Object Detection Output 2: 480x640 1 person, 165.0ms …
[Image: file-VyiMQGF0kqh2lJfEczALIXkn not found]
Object Detection Output 3: 480x640 1 person, 163.8ms …
[Image: file-JmUKhF7FzBkzRCSruKhajKwq not found]
Object Detection Output 4: 480x640 2 persons, 167.1ms …
[Image: file-bQ3NkNaiMFMHBHI1ucgdKW7G not found]
Performance Metrics
The YOLOv8 model achieved the following FPS (frames per second) on the Jetson Nano for
object detection and segmentation tasks:
Model | Detect FPS | Segment FPS |
---|---|---|
yolov8n | 6.1 | |
4.2 | ||
yolov8s | 3.1 | |
yolov8m | 1.3 | |
yolov8l | 0.77 | |
yolov8x | 0.48 | |
Conclusion | ||
2.2 | ||
0.96 | ||
0.61 | ||
0.38 | ||
The project successfully demonstrated the implementation of YOLOv8 for real-time object | ||
detection on the Jetson Nano. The setup and installation were straightforward, and the | ||
model performed adequately given the hardware constraints of the Jetson Nano. Future | ||
work could involve optimizing the model further for better performance or exploring more | ||
complex detection tasks. | ||
YOLOv8, which stands for You Only Look Once version 8, is the latest iteration of a series of | ||
models known for their speed and accuracy in object detection tasks. It builds upon the | ||
successes of its predecessors by incorporating more advanced techniques and | ||
optimizations, making it a suitable choice for real-time applications on resource | ||
constrained devices like the Jetson Nano. | ||
One of the primary challenges encountered during this project was managing the limited | ||
computational resources of the Jetson Nano. Despite this, YOLOv8 performed remarkably | ||
well, achieving a respectable frame rate that would be sufficient for many real-time | ||
applications. This speaks volumes about the efficiency of the YOLOv8 architecture. | ||
Future improvements to this project could include further optimization of the YOLOv8 | ||
model for the Jetson Nano. This could involve techniques such as model pruning and | ||
quantization to reduce the model size and increase inference speed. Additionally, exploring | ||
other versions of YOLOv8 (like yolov8s, yolov8m, yolov8l, and yolov8x) could provide | ||
insights into the trade-offs between speed and accuracy. | ||
Another potential area of exploration is integrating YOLOv8 with other sensors and systems | ||
on the Jetson Nano. For instance, combining YOLOv8 with depth sensors could enhance | ||
object detection capabilities by providing additional context about the environment. | ||
Similarly, integrating with robotic systems could enable autonomous navigation and | ||
interaction based on real-time object detection. | ||
Overall, this project demonstrates the viability of deploying advanced AI models on edge | ||
devices, opening up numerous possibilities for real-time, on-device intelligence in various | ||
applications. | ||
Contact | ||
Darshan Anand | ||
Email: darshananand004@gmail.com | ||
Dayananda Sagar University | ||
CSE - AIML Pre-final Year Student |