Running YOLO object detection on Jetson Nano enables real-time AI inference at the edge, making it ideal for smart cameras, industrial inspection, and intelligent surveillance systems in India. The Jetson Nano’s 128-core Maxwell GPU delivers 472 GFLOPS of computing power, capable of running YOLOv5 or YOLOv8 at 10–30 FPS on HD video. This tutorial covers complete setup from OS install to running your first YOLO demo.
Table of Contents
- Hardware Requirements
- Jetson Nano OS Setup
- NVIDIA DeepStream vs PyTorch Path
- Installing YOLOv8 on Jetson Nano
- Real-Time Camera Demo
- Performance Tuning
- Training Custom YOLO Model
- Frequently Asked Questions
Hardware Requirements
- Jetson Nano Developer Kit (4GB): The primary choice. Discontinued by NVIDIA but available in India at ₹12,000–18,000 second-hand or from importers.
- Jetson Nano 2GB: Budget variant, limited RAM but adequate for YOLO inference with optimised TensorRT models.
- Alternative: Jetson Orin Nano (2024) — more powerful, available at ₹25,000–40,000 in India, officially supported.
- 32GB+ microSD (Class 10 / A2)
- 5V 4A DC power supply (barrel connector)
- USB camera or CSI camera module (IMX219 recommended)
Jetson Nano OS Setup
NVIDIA provides JetPack SDK as the OS image for Jetson devices:
# Step 1: Download JetPack 4.6.x from NVIDIA Developer
# (JetPack 5.x requires Jetson Orin)
# Flash to microSD using Etcher or dd:
# sudo dd if=jetson-nano-jp46.img of=/dev/sdX bs=8M status=progress
# Step 2: First boot setup
# - Accept license, set timezone (Asia/Kolkata)
# - User setup (recommend username: jetson)
# Step 3: Increase swap (critical for compilation!)
sudo fallocate -l 8G /mnt/8GB.swap
sudo chmod 600 /mnt/8GB.swap
sudo mkswap /mnt/8GB.swap
sudo swapon /mnt/8GB.swap
echo '/mnt/8GB.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab
# Step 4: Update and install essentials
sudo apt update && sudo apt upgrade -y
sudo apt install -y python3-pip git cmake libopencv-dev
# Verify CUDA
nvcc --version # Should show CUDA 10.2
python3 -c "import torch; print(torch.cuda.is_available())"
NVIDIA DeepStream vs PyTorch Path
Two main approaches exist for YOLO on Jetson Nano:
- NVIDIA DeepStream: High-performance GStreamer-based pipeline optimised for Jetson. Requires converting YOLO to ONNX then TensorRT. Best for production (highest FPS). Complex setup.
- PyTorch/Ultralytics: Easier setup, Pythonic, supports latest YOLOv8 and YOLOv11. Slightly lower FPS than TensorRT but much simpler. Best for prototyping and custom training. This guide uses this path.
Installing YOLOv8 on Jetson Nano
# Install PyTorch for JetPack 4.6 (ARM64, CUDA 10.2)
# Get the correct wheel from NVIDIA forums or Qengineering
pip3 install torch-*.whl torchvision-*.whl
# Verify PyTorch with CUDA
python3 -c "
import torch
print('PyTorch:', torch.__version__)
print('CUDA available:', torch.cuda.is_available())
print('GPU:', torch.cuda.get_device_name(0))
"
# Install Ultralytics YOLOv8
pip3 install ultralytics --no-deps
pip3 install supervision onnx
# Test YOLO installation
python3 -c "
from ultralytics import YOLO
model = YOLO('yolov8n.pt') # Nano model (fastest)
results = model('https://ultralytics.com/images/bus.jpg')
results[0].save('result.jpg')
print('YOLO test successful')
"
Real-Time Camera Demo
import cv2
from ultralytics import YOLO
import time
# Load YOLOv8 model (nano is fastest on Jetson Nano)
model = YOLO('yolov8n.pt')
# Move to GPU
model.to('cuda')
# Open CSI camera (Jetson Nano CSI pipeline)
def gstreamer_pipeline(width=640, height=480, fps=30):
return (
f"nvarguscamerasrc ! "
f"video/x-raw(memory:NVMM), width={width}, height={height}, "
f"format=NV12, framerate={fps}/1 ! "
f"nvvidconv flip-method=0 ! "
f"video/x-raw, width={width}, height={height}, format=BGRx ! "
f"videoconvert ! video/x-raw, format=BGR ! appsink"
)
cap = cv2.VideoCapture(gstreamer_pipeline(), cv2.CAP_GSTREAMER)
# For USB camera:
# cap = cv2.VideoCapture(0)
fps_count = 0
start = time.time()
while True:
ret, frame = cap.read()
if not ret:
break
# Run YOLO inference on GPU
results = model(frame, verbose=False, conf=0.5)
# Draw results
annotated_frame = results[0].plot()
# FPS counter
fps_count += 1
elapsed = time.time() - start
fps = fps_count / elapsed
cv2.putText(annotated_frame, f'FPS: {fps:.1f}', (10, 30),
cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)
cv2.imshow('YOLO Object Detection - Jetson Nano', annotated_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Performance Tuning
Enable Maximum Performance Mode
# Set Jetson Nano to maximum performance (NVPModel)
sudo nvpmodel -m 0 # Max performance mode (10W)
sudo jetson_clocks # Lock clocks to maximum
# Check current power mode
sudo nvpmodel -q
# Expected YOLO FPS after optimisation:
# YOLOv8n (nano, 640x640): 12-18 FPS on GPU
# YOLOv8s (small, 640x640): 6-12 FPS on GPU
# YOLOv8n (TensorRT FP16): 25-40 FPS (requires export)
TensorRT Export for Maximum Speed
from ultralytics import YOLO
# Export to TensorRT FP16 for maximum Jetson Nano performance
model = YOLO('yolov8n.pt')
model.export(format='engine', half=True, imgsz=640)
# This creates yolov8n.engine
# Load TensorRT model (2-3x faster than PyTorch)
model_trt = YOLO('yolov8n.engine')
# Now run inference with the TRT model
Training Custom YOLO Model
For Indian-specific use cases (detecting specific objects, products, or defects), train a custom model:
# Collect and annotate training data using LabelImg
pip install labelImg
labelimg # Launch annotation tool
# Annotate in YOLO format (.txt files alongside images)
# Dataset structure:
# dataset/
# images/train/ images/val/
# labels/train/ labels/val/
# data.yaml
# data.yaml content:
yaml_content = """
path: ./dataset
train: images/train
val: images/val
nc: 2 # number of classes
names: ['product_ok', 'product_defect']
"""
# Train on PC/cloud (not on Jetson Nano - too slow for training)
from ultralytics import YOLO
model = YOLO('yolov8n.pt') # Start from pretrained
results = model.train(
data='data.yaml',
epochs=50,
imgsz=640,
batch=16
)
# Transfer best.pt to Jetson Nano for inference
Frequently Asked Questions
What is the difference between Jetson Nano 2GB and 4GB for YOLO?
The 4GB model is strongly recommended for YOLO. The 2GB RAM limits the model size you can load — YOLOv8n fits comfortably, but larger models (YOLOv8s, m) will struggle to run alongside the OS on only 2GB. The GPU is identical between the two variants. If you have a 2GB model, use swap and stick to YOLOv8n at 416×416 resolution for reliable operation.
Is Jetson Nano still available in India in 2025?
The original Jetson Nano 4GB Developer Kit is discontinued but available second-hand or through electronics importers in Bangalore, Mumbai, and Delhi at ₹12,000–18,000. The newer Jetson Orin Nano (significantly more powerful) is available from authorised NVIDIA distributors in India. For new projects, consider the Orin Nano or Orin NX which have official software support and 5–10× better performance.
Can YOLO detect Indian traffic signs, vehicles, or people in crowded Indian streets?
The standard YOLOv8 model trained on COCO dataset detects 80 classes including people, cars, motorcycles, buses, and trucks — all common in India’s busy streets. For India-specific objects (auto-rickshaws, specific road signs, cattle), you’ll need to train a custom model. Several Indian research institutions have published datasets of Indian traffic and crowd scenarios — these make excellent starting points for custom YOLO training.
What is the power consumption of Jetson Nano running YOLO?
In maximum performance mode (10W mode), Jetson Nano draws 8–10W from the power supply. In 5W mode, it draws 4–6W with reduced performance. A standard 5V 4A adapter (20W) provides adequate headroom. For battery-powered deployments in the field, calculate 8–10Wh per hour of continuous operation — a 10Ah 5V battery bank provides approximately 5–6 hours of operation.
Add comment