Skip to content

ashnair1/dotadevkit

Repository files navigation

DOTA Devkit

PyPi License Python Version Code style: black

About

This is a modified version of the original DOTA_Devkit. The devkit has had some issues regarding ease of installation and usage with the latter being a significant problem. This repo attemps to address these issues by providing a simple CLI for easier usage and cross-platform whls for easier installation.

Disclaimer: This repo was created post 9938855. The DOTA authors could update the original repo and/or add support for (possible) new versions of the DOTA dataset. While this repo will try to remain in sync with the original, users should rely on the original should the repos diverge.

Installation

pip install dotadevkit

Usage

Once installed, you will have access to the dotadevkit CLI. Run dotadevkit --help or dotadevkit <command> --help for further details.

Usage: dotadevkit [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  convert    Convert tiled DOTA annotations to COCO format.
  evaluate   Run evaluation for both tasks on DOTA & DOTA 1.5.
  merge      Merges annotations according to DOTA Tasks.
  split      Splits images and annotations.
  visualise  Visualise annotations.

Your dataset directory should look as follows:

.
├── example
│   ├── images
│   ├── labelTxt
│   ├── images.txt

Refer example directory in this repo for a concrete example

Split

  1. Split only images with 8 processes
 dotadevkit split \
        ./example/images \
        ./example_split/images \
        8 \
        --images
  1. Split images and labelTxt into tiles of size 800 x 800 with overlap of 200 pixels with 8 processes
 dotadevkit split \
        ./example/ \
        ./example_split/ \
        8 \
        800 \
        200 

Merge

 dotadevkit merge \
        ./example_split/dota_dets \
        ./example_split/merged_dets \
        8

Evaluate

DOTA evaluation on specific task and dataset version.

 dotadevkit evaluate \
        ./example_split/merged_dets/Task1_{:s}.txt \
        ./example/labelTxt/{:s}.txt \
        ./example/images.txt \
        1.0

Visualise

Visualise images that have plane and helicopter categories.

 dotadevkit visualise \
        ./example_split/ \
        -cat plane -cat helicopter

Convert

Convert tiled DOTA annotations of specified version to MS-COCO format.

 dotadevkit convert \
        ./example_split/ \
        --version 1.0