YOLOX in DOTA with KLD loss. (Oriented Object Detection)(Rotated BBox)基于YOLOX的旋转目标检测
- Install YOLOX-OBB(You can refer to the installation of YOLOX)
cd YOLOX-OBB
pip3 install -r requirements.txt
pip3 install -v -e
- Install pycocotools
pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
- Install swig
sudo apt-get install swig
- Create the c++ extension for python
cd DOTA_devkit_YOLO
swig -c++ -python polyiou.i
python setup.py build_ext --inplace
cd -
- Install apex
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir ./
cd -
- Split images and annotations(You can refer to DOTA_devkit_YOLO)
python DOTA_devkit_YOLO/ImgSplit_multi_process.py
- Transform annotations into voc-like format
This is a object in voc-like format annotation:
python custom tools/DOTA2VOC_obb.py
- Organize Directories(All annotations of train-images and val-images must be put into Annotations folder)
|--your_data
|--VOC2012
|--Annotations
|-- xxx.xml
...
|--ImageSets
|--Main
|--train.txt
|--val.txt
|--test.txt
|--JPEGImages
|--JPEGImages-val
|-JPEGImages-test
- Modify configs
change the data path with yours in yolox_dota_s_obb_kld.py
data_dir = 'your_data_path'
- Train
CUDA_VISIBLE_DEVICES=0,1 python3 tools/train.py -f exps/example/yolox_voc/yolox_dota_s_obb_kld.py -d 2 -b 16 --fp16 -c weights/yolox_s.pth.tar
- get results
CUDA_VISIBLE_DEVICES=0,1 python tools/eval.py -f exps/example/yolox_voc/yolox_dota_s_obb_kld.py -d 2 -b 16 -c YOLOX_outputs/yolox_dota_s_obb_kld/latest_ckpt.pth
Results will be save to your_data/results/VOC2012/Main
If test, you must comment line 151 'target = self.load_anno(index)' and uncomment line 152 'target = []' in dota_obb.py before run the above instruction. Because test-set has no annotations.
- Merge results(You can refer to DOTA_devkit_YOLO)
python DOTA_devkit_YOLO/ResultMerge.py
- Evaluation
python DOTA_devkit_YOLO/dota_v1.5_evaluation_task1.py(You can refer to [DOTA_devkit_YOLO](https://github.com/hukaixuan19970627/DOTA_devkit_YOLO))
If test, you should upload your results to DOTA Evaluation Server.
- Evaluation add eval for DOTAv1.0 val, HRSC2016, UCAS-AOD
This implementation get 75.41 mAP@0.5 on DOTA v1.0.