Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DOTA dataset #2551

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add DOTA dataset #2551

wants to merge 5 commits into from

Conversation

nilsleh
Copy link
Collaborator

@nilsleh nilsleh commented Jan 31, 2025

This PR adds the DOTA dataset for object detection.

Dataset rehosted on HF for faster and comprehensive download in one place.

Dataset features:

  • multi-class object detection (15 classes in V1 and 18 classes in V2)
  • horizontal and oriented bounding boxes

Dataset format:

  • images are three channel PNGs with various pixel sizes
  • annotations are text files with one line per bounding box

Horizontal BBox example:

Oriented BBox example:

@dingjiansw101 as inquired in CAPTAIN-WHU/DOTA#29, this is the PR that aims to make the DOTA datset more accessible. The dataset structure in the google and baidu drives was a bit confusing and I restructured it on HF which is hopefully more clear. If you would take a look and have any comments, that would be helpful.

Also @robmarkcole perhaps interesting for you.

Closes #1

@github-actions github-actions bot added documentation Improvements or additions to documentation datasets Geospatial or benchmark datasets testing Continuous integration testing labels Jan 31, 2025
@nilsleh nilsleh marked this pull request as draft January 31, 2025 15:16
@nilsleh nilsleh added this to the 0.7.0 milestone Jan 31, 2025
@nilsleh nilsleh marked this pull request as ready for review February 3, 2025 17:12
@@ -14,6 +14,7 @@ Dataset,Task,Source,License,# Samples,# Classes,Size (px),Resolution (m),Bands
`DeepGlobe Land Cover`_,S,DigitalGlobe +Vivid,-,803,7,"2,448x2,448",0.5,RGB
`DFC2022`_,S,Aerial,"CC-BY-4.0","3,981",15,"2,000x2,000",0.5,RGB
`Digital Typhoon`_,"C, R",Himawari,"CC-BY-4.0","189,364",8,512,5000,Infrared
`DOTA`_,OD,"Google Earth, Gaofen-2, Jilin-1","CC-BY-NC-4.0","5,229",15,"varying","varying",RGB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually use a range of numbers instead of "varying"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you see this license? I agree that it's non-commercial, but there are multiple licenses like that.

Copy link

@dingjiansw101 dingjiansw101 Feb 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOTA also includes aerial imagery provided by CycloMedia B.V.
The Google Earth images must adhere to their guidelines.
For other image sources, I did not mention a specific license in the dataset website, but it should be non-commercial.

class DOTA(NonGeoDataset):
"""DOTA dataset.

The `DOTA <https://captain-whu.github.io/DOTA/index.html>`_ is a large-scale object
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `DOTA <https://captain-whu.github.io/DOTA/index.html>`_ is a large-scale object
`DOTA <https://captain-whu.github.io/DOTA/index.html>`__ is a large-scale object

* helipad


If you use this work in your research, please cite the following paper:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you use this work in your research, please cite the following paper:
If you use this work in your research, please cite the following papers:

Args:
root: root directory where dataset can be found
split: split of the dataset to use, one of ['train', 'val']
version: version of the dataset to use, one of ['1.0', '2.0']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you skipped 1.5? Is it very different?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to also include DOTA-v1.5. The images of DOTA-v1.0 and DOTA-v1.5 are the same. But many small objects are annotated in DOTA-v1.5.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a lot of work to format the data to common structure.

Comment on lines +133 to +135
split: str = 'train',
version: str = '2.0',
bbox_orientation: str = 'hbb',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
split: str = 'train',
version: str = '2.0',
bbox_orientation: str = 'hbb',
split: Literal['train', 'val'] = 'train',
version: Literal['1.0', '2.0'] = '2.0',
bbox_orientation: Literal['hbb', 'obb'] = 'hbb',

If you want to get technical, these type hints are more correct, but we don't yet use them anywhere else in TorchGeo (although we should).

gsd:0.146343590398

Args:
path: path to annotation file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs empty line after it

split: split of the dataset to use, one of ['train', 'val']
version: version of the dataset to use, one of ['1.0', '2.0']
bbox_orientation: bounding box orientation, one of ['hbb', 'obb'], meaning horizontal
or oriented bounding boxes, hbb only available for v2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could make our own hbb for 1.0 just by using min/max. It wouldn't be perfect, but it would be better than the current inconsistency?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, we have provided the hbb labels DOTA-v1.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found any hbb labels for DOTA-v1.0 in the various folders across the google drive. For Version 2, the hbb labels are also just extracted from the obb labels.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +206 to +209
if self.bbox_orientation == 'obb':
boxes, labels = self._load_annotations(sample_row['annotation_path'])
else:
boxes, labels = self._load_annotations(sample_row['annotation_path'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I blind, or are these two lines the same?

else:
boxes, labels = self._load_annotations(sample_row['annotation_path'])

sample['boxes'] = boxes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer uses boxes for compatibility with Kornia, see #1978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets documentation Improvements or additions to documentation testing Continuous integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOTA Dataset
3 participants