This is a fork of the Rotated-RetinaNet implemetation for Google Colab usage. This code was changed to primary support the DOTAv1.5 dataset and a newer Python version.
- Python 3.11.12
- torch 2.6.0+cu124
- cuda_12.5.r12.5/compiler.34385749_0
- gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
The codes build R-RetinaNet for arbitrary-oriented object detection. It supports the following datasets: DOTA, HRSC2016, ICDAR2013, ICDAR2015, UCAS-AOD, NWPU VHR-10, VOC2007.
Follow the demo.ipynb or follow the next steps one by one.
Build the Cython and CUDA modules:
cd $ROOT/utils
sh make.shInstall Dota-devkit:
sudo apt-get install swig
swig -c++ -python polyiou.i
python setup.py build_ext --inplacepython demo.py --weight None- Prepare dataset and move it into the
$ROOTdirectory. First, make sure your initial data are in the following structure.
$ROOT/DOTA
├── train
│ ├──images
│ └── labelTxt
├── val
│ ├── images
│ └── labelTxt
└── test
└── images
Then split the dataset with:
cd $ROOT/datasets/DOTA_devkit
python ImgSplit_multi_process.py \
--raw_root_dir $ROOT/DOTA/train \
--split_root_dir $ROOT/DOTA/trainsplit
!python ImgSplit_multi_process.py \
--raw_root_dir $ROOT/DOTA/val \
--split_root_dir $ROOT/DOTA/valsplit
- Generate imageset files:
cd $ROOT/datasets
python generate_imageset.py-
Adjust the hyperparameters in
hyp.pyfile. -
Start training:
python train.pystart evaluation:
python eval.pyNote that :
- the script needs to be executed only once.
- the imageset file used is generated from
generate_imageset.py.