Git Product home page Git Product logo

yolox-obb's Introduction

YOLOX-OBB

YOLOX in DOTA with KLD loss. (Oriented Object Detection)(Rotated BBox)基于YOLOX的旋转目标检测

Installation

  1. Install YOLOX-OBB(You can refer to the installation of YOLOX)
cd YOLOX-OBB
pip3 install -r requirements.txt
pip3 install -v -e
  1. Install pycocotools
pip3 install cython; pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
  1. Install swig
sudo apt-get install swig
  1. Create the c++ extension for python
cd DOTA_devkit_YOLO
swig -c++ -python polyiou.i
python setup.py build_ext --inplace
cd -
  1. Install apex
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --no-cache-dir ./
cd -

Data Preparation

  1. Split images and annotations(You can refer to DOTA_devkit_YOLO)
 python DOTA_devkit_YOLO/ImgSplit_multi_process.py
  1. Transform annotations into voc-like format
  • This is a object in voc-like format annotation:

python custom tools/DOTA2VOC_obb.py
  1. 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

Train

  1. Modify configs

 change the data path with yours in yolox_dota_s_obb_kld.py

data_dir = 'your_data_path'
  1. 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

Val

  1. 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.
  1. Merge results(You can refer to DOTA_devkit_YOLO)
python DOTA_devkit_YOLO/ResultMerge.py
  1. 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.

Unfortunately

This implementation only get 0.712 [email protected] on DOTA v1.0.

Reference

YOLOX

DOTA_devkit_YOLO

YOLOv5_DOTA_OBB

RotationDetection

yolox-obb's People

Contributors

buzhidaoshenme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.