Skip to content

This repository contains code for drone localization using the YOLOv8 object detection model. The model is trained to detect drones in images and videos in real-time. Additionally, it includes evaluation metrics such as precision-recall curves, F1 curve, and confusion matrix, providing insights into the model's performance.

Notifications You must be signed in to change notification settings

benab04/Drone-Localization

Repository files navigation

YOLOv8 Drone Localization

Open In Colab

This repository contains code for drone localization using the YOLOv8 object detection model. The model is trained to detect drones in images and videos in real-time. Additionally, it includes evaluation metrics such as precision-recall curves, F1 curve, and confusion matrix, providing insights into the model's performance.

Features

  • Detection of drones in images and videos using YOLOv8.
  • Evaluation metrics for assessing model performance.
  • Real-time tracking of drones in videos.
  • Various visualization tools for analyzing model results.

Applications

The YOLOv8 model for drone localization has several applications in different fields:

  1. Surveillance and Security: Drones are increasingly being used for surveillance purposes. This model can help security personnel detect and track drones in restricted areas.

  2. Environmental Monitoring: Drones equipped with sensors can monitor environmental parameters such as air quality, temperature, and pollution levels. This model can assist in identifying and tracking drones used for environmental monitoring tasks.

  3. Infrastructure Inspection: Drones are used for inspecting infrastructure such as bridges, pipelines, and power lines. This model can aid in detecting drones during inspection activities, ensuring safety and security.

  4. Event Security: At public events and gatherings, drones may pose security risks. This model can be deployed to monitor the airspace and detect unauthorized drones.

Repository Contents

  • Images: Contains sample images of detected drones using the YOLOv8 model. Add your detected drone images here.
  • Evaluation Metrics: Includes plots of precision-recall curves, F1 curve, PR curve, P curve, R curve, and confusion matrix. Add your evaluation curves and metrics here.
  • Video: Provides a real-time detection video demonstrating the model's performance.

Getting Started

To use the YOLOv8 model for drone localization, follow these steps:

  1. Clone the repository:

    git clone https://github.com/benab04/Drone-Localization.git
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Run the model on your images or videos: The dataset used for training and testing is:

    kaggle datasets download -d muki2003/yolo-drone-detection-dataset

To further fine tune the model based on a custom dataset:

  1. Load the model:

    from ultralytics import YOLO
    model = YOLO("runs/detect/train2/weights/200_epoch.pt")
  2. Update data.yaml file with your custom dataset:

    config = {
    "path": "/path/to/dataset",
    "train": "/path/to/dataset/train",
    "val": "/path/to/dataset/valid",
    "nc": 1,
    "names": ["drone"],
    }
    
    with open("data.yaml", "w") as file:
        yaml.dump(config, file, default_flow_style=False)
  3. Train the model: The dataset used for training and testing is:

    results = model.train(data="data.yaml", epochs=100, save_period=10, seed=seed)

Results

Detected Drones in dataset

Test results

Evaluation Metrics

metrics

Precision-Recall Curve

PR_curve

Confusion Matrix

Confusion Matrix

Acknowledgments

  • This project is inspired by the YOLOv8 model implementation by Ultralytics.

About

This repository contains code for drone localization using the YOLOv8 object detection model. The model is trained to detect drones in images and videos in real-time. Additionally, it includes evaluation metrics such as precision-recall curves, F1 curve, and confusion matrix, providing insights into the model's performance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages