Skip to content

Drone YOLO Object Detection πŸ“¦πŸ›©οΈ This repository contains a full pipeline for training a YOLOv8 model on custom drone footage data for object detection and line-crossing analysis. The implementation uses the Ultralytics YOLOv8 framework and is tailored for lightweight and fast inference using the YOLOv8 Nano variant.

License

Notifications You must be signed in to change notification settings

ComputerVision804/HawkWatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HawkWatch

Drone YOLO Object Detection πŸ“¦πŸ›©οΈ This repository contains a full pipeline for training a YOLOv8 model on custom drone footage data for object detection and line-crossing analysis. The implementation uses the Ultralytics YOLOv8 framework and is tailored for lightweight and fast inference using the YOLOv8 Nano variant.

🧠 Project Overview This project trains a YOLOv8 model to detect objects from drone footage. The detections can later be used for advanced tasks like object counting, trajectory tracking, and boundary-line crossing analytics.

πŸ“ Directory Structure The dataset is organized as per the YOLO format. Below is the visual layout: ChatGPT Image May 11, 2025, 06_34_02 AM

drone_yolo_dataset/ β”œβ”€β”€ train/ β”‚ β”œβ”€β”€ images/ β†’ Training images β”‚ └── labels/ β†’ Corresponding YOLO labels β”œβ”€β”€ val/ β”‚ β”œβ”€β”€ images/ β†’ Validation images β”‚ └── labels/ β†’ Corresponding YOLO labels β”œβ”€β”€ test/ β”‚ β”œβ”€β”€ images/ β†’ Test images β”‚ └── labels/ β†’ Corresponding YOLO labels data.yaml β†’ Configuration file linking datasets and class names πŸ“„ data.yaml Configuration This file defines the dataset paths and class names for the model:

yaml train: drone_yolo_dataset/train/images val: drone_yolo_dataset/val/images test: drone_yolo_dataset/test/images

nc: 1 # Number of classes names: ['drone_object'] # Class names Make sure this file is in the project root and correctly references the dataset folder paths.

πŸš€ Training Script A minimal script to train the model using Ultralytics:

from ultralytics import YOLO import os

Create dataset structure if not present

required_dirs = [ "drone_yolo_dataset/train/images", "drone_yolo_dataset/train/labels", "drone_yolo_dataset/val/images", "drone_yolo_dataset/val/labels", "drone_yolo_dataset/test/images", "drone_yolo_dataset/test/labels" ] for d in required_dirs: os.makedirs(d, exist_ok=True)

Load YOLOv8 Nano model

model = YOLO("yolov8n.yaml") Figure_1 1 Figure_11

Train the model

model.train( data="data.yaml", epochs=50, imgsz=640, batch=16, name="drone_yolo_model", project="runs/train", workers=4, val=True )

Evaluate the model

metrics = model.val(data="data.yaml", split="test") print("Test metrics:", metrics)

Run predictions

results = model.predict(source="drone_yolo_dataset/test/images", save=True) βœ… Requirements

pip install ultralytics Ensure that torch and opencv-python are also installed for smooth training and prediction.

πŸ“Š Output Trained model weights: runs/train/drone_yolo_model/weights/best.pt

Prediction results saved in the current directory (with bounding boxes)

πŸ“Œ Notes Label format follows YOLO: [class_id x_center y_center width height], all normalized.

Ensure correct image-label pairing (same filenames, different extensions).ChatGPT Image May 11, 2025, 06_36_32 AM Figure_1

You can visualize predictions using model.predict(...) or explore results using the YOLO UI.

About

Drone YOLO Object Detection πŸ“¦πŸ›©οΈ This repository contains a full pipeline for training a YOLOv8 model on custom drone footage data for object detection and line-crossing analysis. The implementation uses the Ultralytics YOLOv8 framework and is tailored for lightweight and fast inference using the YOLOv8 Nano variant.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published