Skip to main content

Coconut tree detection from drone imagery

Project description

Object Detection on Aerial Imagery for Coconut Trees Detection

Coconut tree detection from drone imagery using YOLOv8, Yolov12, and RT_DERT models with OpenStreetMap labels and OpenAerialMap imagery.

Overview

  • OpenStreetMap point data: bounding boxes with buffer zones
  • Tile large aerial imagery (256×256 at 9cm/pixel): Source
  • Convert geographic coordinates to YOLO format
  • Train multiple models of YOLOv8 (nano, small, medium) on coconut trees from Kolovai, Tonga
  • Train Yolov12 and also RT-DERT.

Source: World Bank - Automated Feature Detection of Aerial Imagery from the South Pacific

Data

Statistics:

  • Original: 10,631 trees (Coconut: 10,092 | Mango: 261 | Banana: 181 | Papaya: 97)
  • Target: Coconut trees only
  • Tiles: 256×256px at zoom 19, EPSG:4326
  • Train/Val: 441 / 167 tiles (80/20 stratified split), but we did later 70,20,10 for train, val, test for hyperparameter tuning and improve model accuracy.

Structure

data/
├── raw/                # OAM imagery + OSM points
├── chips/              # 256×256 tiles (.tif)
├── labels/             # Per-tile annotations (.geojson)
└── yolo/
    ├── train/          # Training data (.png + .txt)
    ├── val/            # Validation data
    └── config.yaml     # YOLO config

notebooks/
├── experiment.ipynb         # including the dl4cv-oda package and all functions

Setup

curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/kshitijrajsharma/dl4cv-object-detection-on-aerial-imagery
cd dl4cv-object-detection-on-aerial-imagery
uv sync
pip install dl4cv_oda

Workflow

image

1. Clean OSM Data : Filter coconut trees, generate buffered bounding boxes

2. Tile Imagery : Create 256×256 tiles, clip labels to tile extents

3. YOLO Conversion : Transform coordinates (EPSG:4326 : pixels : normalized [0,1])

row, col = src.index(lon, lat)  # rasterio
x_norm = col / img_width
y_norm = row / img_height

4. Train : YOLOv8n, 100 epochs, batch 16

from ultralytics import YOLO
model = YOLO('yolov8n.pt')
model.train(data='data/yolo/config.yaml', epochs=100, imgsz=256, batch=16)

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dl4cv_oda-0.1.1.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dl4cv_oda-0.1.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file dl4cv_oda-0.1.1.tar.gz.

File metadata

  • Download URL: dl4cv_oda-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for dl4cv_oda-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9b7befea6c35981c03212021557c9f2e90b5987aa1f17474e93f034965d12504
MD5 3a7636c6a97e1046e4ff74c9d186031a
BLAKE2b-256 9cfa3dc74696c8c7513e790d72b65018b1c19a45132efc35223a2a377e032a64

See more details on using hashes here.

File details

Details for the file dl4cv_oda-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dl4cv_oda-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for dl4cv_oda-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29fd6d08d4043dcd5d715ac32a85ac1ca3b4a4ba1c6603d8070fd52d5e2b0769
MD5 792bf92715842aac2c20810dc8075c1f
BLAKE2b-256 58c4389e6a8789973d587e8ae5aaf9dbd53bb89955fb7c998365b79b08fee654

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page