Skip to content

domfoo/drone-project

Repository files navigation

Drone Project - AI-Powered Trash Detection

A real-time object detection system for drones using YOLOv8, developed as part of the Drohnen mit Künstlicher Intelligenz module (Master-Projekt - Studienfeld Intelligente Systeme, WS2526) at Frankfurt University of Applied Sciences.

Team Members

  • Dominik Bartsch
  • Gajus Petrauskas
  • Nhat Khanh Hoang

Project Overview

This project implements a real-time trash detection system for drones using YOLOv8. The system processes video streams from drone cameras and communicates with the drone's flight controller via a Raspberry Pi bridge.

Key Files

  • inference.py - Main script for running the YOLOv8 model inference on video streams
  • real_mission.py - Handles communication between the local computer and the drone through Raspberry Pi (UDP-based)
  • setup_test.py - Check if local computer is correctly setup for WasteWing
  • yolov8n_waste.pt - Pre-trained YOLOv8 model weights file

The project poster and the 3d printable drop mechanism can be found in the assets folder.

Basic Usage

Prerequisites

  1. Ensure your computer and Raspberry Pi are connected to the same network
  2. Install dependencies:
    pip install -r requirements.txt
    Make sure torch and torchvision are installed with GPU support to ensure maximum inference performance.

Running the Model

Run the inference script with the model weights:

python inference.py -w yolov8n_waste.pt -s 1 --show

Parameters:

  • -w / --weights: Path to the model weights file (e.g., yolov8n_waste.pt)
  • -s / --source: Video source (0 for webcam, 1 for capture card, or path to video file)
  • --show: Display the detection results in real-time

Additional Options

For more advanced usage, see the help menu:

python inference.py --help

Using uv

This project can be run using uv as well

uv sync
uv run inference -w yolov8n_waste.pt -s 1

Requirements

See requirements.txt for the complete list of dependencies. Main requirements include:

  • Ultralytics YOLOv8
  • PyTorch
  • OpenCV
  • NumPy

Architecture

The system consists of:

  1. Local Computer: Runs YOLOv8 inference on video streams
  2. Raspberry Pi: Acts as a bridge for UDP communication with the drone's flight controller
  3. Drone: Receives commands based on detection results

License

See LICENSE file for details.

About

Waste detection powered by AI via drone

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5