Skip to content

Add YOLOv8n real-time road hazard detection for Jetson Nano#1

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-computer-vision-yolov8n
Draft

Add YOLOv8n real-time road hazard detection for Jetson Nano#1
Copilot wants to merge 3 commits into
mainfrom
copilot/add-computer-vision-yolov8n

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 8, 2026

Bootstraps the project from a README-only state into a functional YOLOv8n inference pipeline targeting the Jetson Nano, with support for CSI/USB cameras, custom model fine-tuning, and optional video/CSV output.

New files

  • detect.py — Main inference loop: loads YOLOv8n, reads camera frames, runs model.predict(), overlays bounding boxes, optionally saves annotated video and logs detections to CSV. CLI flags: --config, --weights, --source, --conf, --no-display
  • train.py — Fine-tuning wrapper around model.train() with flags for --data, --epochs, --batch, --imgsz, --device, --resume
  • utils.py — GStreamer CSI pipeline builder, open_video_source (CSI/USB/file/RTSP), draw_detections, setup_csv_logger/log_detections
  • config.yaml — All runtime settings: model weights/confidence/IOU, camera source & resolution, per-class colours, video/CSV output paths
  • requirements.txtultralytics, opencv-python, numpy, PyYAML, Pillow
  • .gitignore — Excludes __pycache__, venv, YOLO run artefacts (runs/, *.pt), output files

Default hazard classes (configurable in config.yaml)

pothole, crack, debris, manhole, bump

Quick start

pip install -r requirements.txt

# Live detection via CSI camera (default)
python detect.py

# USB webcam, custom weights, headless
python detect.py --source 0 --weights runs/train/road_hazard/weights/best.pt --no-display

# Fine-tune on custom dataset
python train.py --data dataset/dataset.yaml --epochs 50 --batch 8

Jetson Nano: install python3-opencv via apt instead of pip to get hardware-accelerated GStreamer support, then drop opencv-python from requirements.txt.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dns.google
    • Triggering command: /usr/bin/python python detect.py --help (dns block)
    • Triggering command: /usr/bin/python python train.py --help (dns block)
    • Triggering command: /usr/bin/python python -c import detect; print('detect imports OK') (dns block)
  • one.one.one.one
    • Triggering command: /usr/bin/python python detect.py --help (dns block)
    • Triggering command: /usr/bin/python python train.py --help (dns block)
    • Triggering command: /usr/bin/python python -c import detect; print('detect imports OK') (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

I have a python based Jetson nano project using yolov8n for computer vision


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 9, 2026 00:01
Co-authored-by: Sped32DJ <79542174+Sped32DJ@users.noreply.github.com>
Co-authored-by: Sped32DJ <79542174+Sped32DJ@users.noreply.github.com>
Copilot AI changed the title [WIP] Add YOLOv8n for computer vision on Jetson Nano Add YOLOv8n real-time road hazard detection for Jetson Nano Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants