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.
- 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.
The YOLOv8 model for drone localization has several applications in different fields:
-
Surveillance and Security: Drones are increasingly being used for surveillance purposes. This model can help security personnel detect and track drones in restricted areas.
-
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.
-
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.
-
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.
- 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.
To use the YOLOv8 model for drone localization, follow these steps:
-
Clone the repository:
git clone https://github.com/benab04/Drone-Localization.git
-
Install the required dependencies:
pip install -r requirements.txt
-
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:
-
Load the model:
from ultralytics import YOLO model = YOLO("runs/detect/train2/weights/200_epoch.pt") -
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) -
Train the model: The dataset used for training and testing is:
results = model.train(data="data.yaml", epochs=100, save_period=10, seed=seed)
- This project is inspired by the YOLOv8 model implementation by Ultralytics.



