commit
8fce7bfc29
48 changed files with 814 additions and 309 deletions
@ -0,0 +1,129 @@ |
|||||||
|
--- |
||||||
|
comments: true |
||||||
|
description: Delve into DOTA v2, an Oriented Bounding Box (OBB) aerial imagery dataset with 1.7 million instances and 11,268 images. |
||||||
|
keywords: DOTA v2, object detection, aerial images, computer vision, deep learning, annotations, oriented bounding boxes, OBB |
||||||
|
--- |
||||||
|
|
||||||
|
# DOTA v2 Dataset with OBB |
||||||
|
|
||||||
|
[DOTA v2](https://captain-whu.github.io/DOTA/index.html) stands as a specialized dataset, emphasizing object detection in aerial images. Originating from the DOTA series of datasets, it offers annotated images capturing a diverse array of aerial scenes with Oriented Bounding Boxes (OBB). |
||||||
|
|
||||||
|
![DOTA v2 classes visual](https://user-images.githubusercontent.com/26833433/259461765-72fdd0d8-266b-44a9-8199-199329bf5ca9.jpg) |
||||||
|
|
||||||
|
## Key Features |
||||||
|
|
||||||
|
- Collection from various sensors and platforms, with image sizes ranging from 800 × 800 to 20,000 × 20,000 pixels. |
||||||
|
- Features more than 1.7M Oriented Bounding Boxes across 18 categories. |
||||||
|
- Encompasses multiscale object detection. |
||||||
|
- Instances are annotated by experts using arbitrary (8 d.o.f.) quadrilateral, capturing objects of different scales, orientations, and shapes. |
||||||
|
|
||||||
|
## Dataset Versions |
||||||
|
|
||||||
|
### DOTA-v1.0 |
||||||
|
|
||||||
|
- Contains 15 common categories. |
||||||
|
- Comprises 2,806 images with 188,282 instances. |
||||||
|
- Split ratios: 1/2 for training, 1/6 for validation, and 1/3 for testing. |
||||||
|
|
||||||
|
### DOTA-v1.5 |
||||||
|
|
||||||
|
- Incorporates the same images as DOTA-v1.0. |
||||||
|
- Very small instances (less than 10 pixels) are also annotated. |
||||||
|
- Addition of a new category: "container crane". |
||||||
|
- A total of 403,318 instances. |
||||||
|
- Released for the DOAI Challenge 2019 on Object Detection in Aerial Images. |
||||||
|
|
||||||
|
### DOTA-v2.0 |
||||||
|
|
||||||
|
- Collections from Google Earth, GF-2 Satellite, and other aerial images. |
||||||
|
- Contains 18 common categories. |
||||||
|
- Comprises 11,268 images with a whopping 1,793,658 instances. |
||||||
|
- New categories introduced: "airport" and "helipad". |
||||||
|
- Image splits: |
||||||
|
- Training: 1,830 images with 268,627 instances. |
||||||
|
- Validation: 593 images with 81,048 instances. |
||||||
|
- Test-dev: 2,792 images with 353,346 instances. |
||||||
|
- Test-challenge: 6,053 images with 1,090,637 instances. |
||||||
|
|
||||||
|
## Dataset Structure |
||||||
|
|
||||||
|
DOTA v2 exhibits a structured layout tailored for OBB object detection challenges: |
||||||
|
|
||||||
|
- **Images**: A vast collection of high-resolution aerial images capturing diverse terrains and structures. |
||||||
|
- **Oriented Bounding Boxes**: Annotations in the form of rotated rectangles encapsulating objects irrespective of their orientation, ideal for capturing objects like airplanes, ships, and buildings. |
||||||
|
|
||||||
|
## Applications |
||||||
|
|
||||||
|
DOTA v2 serves as a benchmark for training and evaluating models specifically tailored for aerial image analysis. With the inclusion of OBB annotations, it provides a unique challenge, enabling the development of specialized object detection models that cater to aerial imagery's nuances. |
||||||
|
|
||||||
|
## Dataset YAML |
||||||
|
|
||||||
|
Typically, datasets incorporate a YAML (Yet Another Markup Language) file detailing the dataset's configuration. For DOTA v2, a hypothetical `DOTAv2.yaml` could be used. For accurate paths and configurations, it's vital to consult the dataset's official repository or documentation. |
||||||
|
|
||||||
|
!!! example "DOTAv2.yaml" |
||||||
|
|
||||||
|
```yaml |
||||||
|
--8<-- "ultralytics/cfg/datasets/DOTAv2.yaml" |
||||||
|
``` |
||||||
|
|
||||||
|
## Usage |
||||||
|
|
||||||
|
To train a model on the DOTA v2 dataset, you can utilize the following code snippets. Always refer to your model's documentation for a thorough list of available arguments. |
||||||
|
|
||||||
|
!!! warning |
||||||
|
|
||||||
|
Please note that all images and associated annotations in the DOTAv2 dataset can be used for academic purposes, but commercial use is prohibited. Your understanding and respect for the dataset creators' wishes are greatly appreciated! |
||||||
|
|
||||||
|
!!! example "Train Example" |
||||||
|
|
||||||
|
=== "Python" |
||||||
|
|
||||||
|
```python |
||||||
|
from ultralytics import YOLO |
||||||
|
|
||||||
|
# Create a new YOLOv8n-OBB model from scratch |
||||||
|
model = YOLO('yolov8n-obb.yaml') |
||||||
|
|
||||||
|
# Train the model on the DOTAv2 dataset |
||||||
|
results = model.train(data='DOTAv2.yaml', epochs=100, imgsz=640) |
||||||
|
``` |
||||||
|
|
||||||
|
=== "CLI" |
||||||
|
|
||||||
|
```bash |
||||||
|
# Train a new YOLOv8n-OBB model on the DOTAv2 dataset |
||||||
|
yolo detect train data=DOTAv2.yaml model=yolov8n.pt epochs=100 imgsz=640 |
||||||
|
``` |
||||||
|
|
||||||
|
## Sample Data and Annotations |
||||||
|
|
||||||
|
Having a glance at the dataset illustrates its depth: |
||||||
|
|
||||||
|
![Dataset sample image](https://captain-whu.github.io/DOTA/images/instances-DOTA.jpg) |
||||||
|
|
||||||
|
- **DOTA v2**: This snapshot underlines the complexity of aerial scenes and the significance of Oriented Bounding Box annotations, capturing objects in their natural orientation. |
||||||
|
|
||||||
|
The dataset's richness offers invaluable insights into object detection challenges exclusive to aerial imagery. |
||||||
|
|
||||||
|
## Citations and Acknowledgments |
||||||
|
|
||||||
|
For those leveraging DOTA v2 in their endeavors, it's pertinent to cite the relevant research papers: |
||||||
|
|
||||||
|
!!! note "" |
||||||
|
|
||||||
|
=== "BibTeX" |
||||||
|
|
||||||
|
```bibtex |
||||||
|
@article{9560031, |
||||||
|
author={Ding, Jian and Xue, Nan and Xia, Gui-Song and Bai, Xiang and Yang, Wen and Yang, Michael and Belongie, Serge and Luo, Jiebo and Datcu, Mihai and Pelillo, Marcello and Zhang, Liangpei}, |
||||||
|
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, |
||||||
|
title={Object Detection in Aerial Images: A Large-Scale Benchmark and Challenges}, |
||||||
|
year={2021}, |
||||||
|
volume={}, |
||||||
|
number={}, |
||||||
|
pages={1-1}, |
||||||
|
doi={10.1109/TPAMI.2021.3117983} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
A special note of gratitude to the team behind DOTA v2 for their commendable effort in curating this dataset. For an exhaustive understanding of the dataset and its nuances, please visit the [official DOTA v2 website](https://captain-whu.github.io/DOTA/index.html). |
@ -0,0 +1,80 @@ |
|||||||
|
--- |
||||||
|
comments: true |
||||||
|
description: Dive deep into various oriented bounding box (OBB) dataset formats compatible with the Ultralytics YOLO model. Grasp the nuances of using and converting datasets to this format. |
||||||
|
keywords: Ultralytics, YOLO, oriented bounding boxes, OBB, dataset formats, label formats, DOTA v2, data conversion |
||||||
|
--- |
||||||
|
|
||||||
|
# Oriented Bounding Box Datasets Overview |
||||||
|
|
||||||
|
Training a precise object detection model with oriented bounding boxes (OBB) requires a thorough dataset. This guide elucidates the various OBB dataset formats compatible with the Ultralytics YOLO model, offering insights into their structure, application, and methods for format conversions. |
||||||
|
|
||||||
|
## Supported OBB Dataset Formats |
||||||
|
|
||||||
|
### YOLO OBB Format |
||||||
|
|
||||||
|
The YOLO OBB format designates bounding boxes by their four corner points with coordinates normalized between 0 and 1. It follows this format: |
||||||
|
|
||||||
|
```bash |
||||||
|
class_index, x1, y1, x2, y2, x3, y3, x4, y4 |
||||||
|
``` |
||||||
|
|
||||||
|
Internally, YOLO processes losses and outputs in the `xywhr` format, which represents the bounding box's center point (xy), width, height, and rotation. |
||||||
|
|
||||||
|
<p align="center"><img width="800" src="https://user-images.githubusercontent.com/26833433/259471881-59020fe2-09a4-4dcc-acce-9b0f7cfa40ee.png"></p> |
||||||
|
|
||||||
|
An example of a `*.txt` label file for the above image, which contains an object of class `0` in OBB format, could look like: |
||||||
|
|
||||||
|
```bash |
||||||
|
0 0.780811 0.743961 0.782371 0.74686 0.777691 0.752174 0.776131 0.749758 |
||||||
|
``` |
||||||
|
|
||||||
|
## Usage |
||||||
|
|
||||||
|
To train a model using these OBB formats: |
||||||
|
|
||||||
|
!!! example "" |
||||||
|
|
||||||
|
=== "Python" |
||||||
|
|
||||||
|
```python |
||||||
|
from ultralytics import YOLO |
||||||
|
|
||||||
|
# Create a new YOLOv8n-OBB model from scratch |
||||||
|
model = YOLO('yolov8n-obb.yaml') |
||||||
|
|
||||||
|
# Train the model on the DOTAv2 dataset |
||||||
|
results = model.train(data='DOTAv2.yaml', epochs=100, imgsz=640) |
||||||
|
``` |
||||||
|
|
||||||
|
=== "CLI" |
||||||
|
|
||||||
|
```bash |
||||||
|
# Train a new YOLOv8n-OBB model on the DOTAv2 dataset |
||||||
|
yolo detect train data=DOTAv2.yaml model=yolov8n.pt epochs=100 imgsz=640 |
||||||
|
``` |
||||||
|
|
||||||
|
## Supported Datasets |
||||||
|
|
||||||
|
Currently, the following datasets with Oriented Bounding Boxes are supported: |
||||||
|
|
||||||
|
- [**DOTA v2**](./dota-v2.md): DOTA (A Large-scale Dataset for Object Detection in Aerial Images) version 2, emphasizes detection from aerial perspectives and contains oriented bounding boxes with 1.7 million instances and 11,268 images. |
||||||
|
|
||||||
|
### Incorporating your own OBB dataset |
||||||
|
|
||||||
|
For those looking to introduce their own datasets with oriented bounding boxes, ensure compatibility with the "YOLO OBB format" mentioned above. Convert your annotations to this required format and detail the paths, classes, and class names in a corresponding YAML configuration file. |
||||||
|
|
||||||
|
## Convert Label Formats |
||||||
|
|
||||||
|
### DOTA Dataset Format to YOLO OBB Format |
||||||
|
|
||||||
|
Transitioning labels from the DOTA dataset format to the YOLO OBB format can be achieved with this script: |
||||||
|
|
||||||
|
```python |
||||||
|
from ultralytics.data.converter import convert_dota_to_yolo_obb |
||||||
|
|
||||||
|
convert_dota_to_yolo_obb('path/to/DOTA') |
||||||
|
``` |
||||||
|
|
||||||
|
This conversion mechanism is instrumental for datasets in the DOTA format, ensuring alignment with the Ultralytics YOLO OBB format. |
||||||
|
|
||||||
|
It's imperative to validate the compatibility of the dataset with your model and adhere to the necessary format conventions. Properly structured datasets are pivotal for training efficient object detection models with oriented bounding boxes. |
@ -0,0 +1,37 @@ |
|||||||
|
# Ultralytics YOLO 🚀, AGPL-3.0 license |
||||||
|
# DOTA 2.0 dataset https://captain-whu.github.io/DOTA/index.html for object detection in aerial images by Wuhan University |
||||||
|
# Example usage: yolo train model=yolov8n-obb.pt data=DOTAv2.yaml |
||||||
|
# parent |
||||||
|
# ├── ultralytics |
||||||
|
# └── datasets |
||||||
|
# └── dota2 ← downloads here (2GB) |
||||||
|
|
||||||
|
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] |
||||||
|
path: ../datasets/DOTAv2 # dataset root dir |
||||||
|
train: images/train # train images (relative to 'path') 1411 images |
||||||
|
val: images/val # val images (relative to 'path') 458 images |
||||||
|
test: images/test # test images (optional) 937 images |
||||||
|
|
||||||
|
# Classes for DOTA 2.0 |
||||||
|
names: |
||||||
|
0: plane |
||||||
|
1: ship |
||||||
|
2: storage tank |
||||||
|
3: baseball diamond |
||||||
|
4: tennis court |
||||||
|
5: basketball court |
||||||
|
6: ground track field |
||||||
|
7: harbor |
||||||
|
8: bridge |
||||||
|
9: large vehicle |
||||||
|
10: small vehicle |
||||||
|
11: helicopter |
||||||
|
12: roundabout |
||||||
|
13: soccer ball field |
||||||
|
14: swimming pool |
||||||
|
15: container crane |
||||||
|
16: airport |
||||||
|
17: helipad |
||||||
|
|
||||||
|
# Download script/URL (optional) |
||||||
|
download: https://github.com/ultralytics/yolov5/releases/download/v1.0/DOTAv2.zip |
Loading…
Reference in new issue