Skip to content

The Drone Detection System is a Python application that uses the YOLO (You Only Look Once) framework for real-time drone detection. With OpenCV and a custom-trained dataset, it can identify drones via webcam or analyze pre-recorded videos, enhancing security and surveillance. su

License

Notifications You must be signed in to change notification settings

bhavishyasingla1/drone_detection

Repository files navigation

Table of Contents

Drone Detection System

This is a Python-based drone detection system that utilizes YOLO (You Only Look Once) for object detection on a custom-trained drone dataset. It can detect drones in real time using a webcam or in video files. This project was created using OpenCV and YOLOv8.

Features

  • Real-time drone detection using a webcam

  • Drone detection on pre-recorded video files

  • Custom YOLOv8 model trained on a drone detection dataset

    napkin-selection (1)

Dataset

The model was trained on a custom drone detection dataset from Kaggle's YOLO Drone Detection Dataset.

Files

  • data.yaml: Dataset configuration file for YOLOv8 training.
  • drone.mp4: Example video file for testing the detection.
  • main.py: Script for training the dataset.
  • predict_video.py: Script for detection on a video file.
  • predict_webcam.py: script for real-time detection using a webcam.
  • yolov8n_trained.pt: Trained YOLOv8 model for drone detection.

napkin-selection (2)

Example Outputs

Here are some example outputs from the drone detection system:

Webcam Detection Example

  • Description: An example of drone detection using a webcam.
  • Output:

image

Video Detection Example

Getting Started

Prerequisites

Ensure that Python 3.12.7 is installed on your machine.

Installation

  1. Clone the repository:
    git clone https://github.com/bhavishyasingla1/drone_detection.git
    cd drone_detection
  2. Install dependencies:
    pip install -r requirements.txt

napkin-selection (3)

Usage

  1. Running Detection on Webcam:

    Run the following command:

    python predict_webcam.py

    This will open your webcam and start detecting drones in real-time.

  2. Running Detection on a Video File:

    Modify video_path in predict_video.py to your desired video file path:

    video_path = 'path/to/your/video.mp4'

    Run the script:

    python predict_video.py

    Output: Detected videos will be saved as output.mp4 in the same directory as the script.

    napkin-selection (4)

Training

To train the model on your dataset, ensure data.yaml is correctly configured, and then run main.py using the following command:

  python main.py

the output yolov8n_trained.pt will be saved in same directory as the script.

You can refer to the Kaggle YOLO Drone Detection Dataset for the dataset used. Watch Computer Vision Engineer - YouTube Video to learn how to train your own custom dataset.

Acknowledgments

  • OpenCV for computer vision functionalities.
  • YOLOv8 for object detection framework.
  • Kaggle for providing the dataset.

napkin-selection (5)

Contact

If you have any questions or feedback, feel free to reach out:

Troubleshooting

  • ModuleNotFoundError: Ensure all dependencies are installed using pip install -r requirements.txt.

  • Performance issues: Make sure your machine meets the required specifications for running YOLOv8.

    Future Improvements

  • Implement multi-drone detection capabilities.

  • Enhance model accuracy with more diverse datasets.

  • Create a user interface for easier interaction.

    napkin-selection (6)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The Drone Detection System is a Python application that uses the YOLO (You Only Look Once) framework for real-time drone detection. With OpenCV and a custom-trained dataset, it can identify drones via webcam or analyze pre-recorded videos, enhancing security and surveillance. su

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages