Skip to content

Detecting rotation frame of remote sensing image;Separable convolution

License

Notifications You must be signed in to change notification settings

AllenMusk/Rotating-frame

Repository files navigation

YOLOv5_DOTA_OBB

YOLOv5 in DOTA_OBB dataset with CSL_label.(Oriented Object Detection)

Datasets and pretrained checkpoint

Fuction

  • train.py. Train.

  • detect.py. Detect and visualize the detection result. Get the detection result txt.

  • evaluation.py. Merge the detection result and visualize it. Finally evaluate the detector

Installation (Linux Recommend, Windows not Recommend)

1. Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt 

2. Install swig

$ cd \.....\yolov5_DOTA_OBB\utils $ sudo apt-get install swig 

3. Create the c++ extension for python

$ swig -c++ -python polyiou.i $ python setup.py build_ext --inplace 

Usage Example

1.'Get Dataset'

$ classid x_c y_c longside shortside Θ Θ∈[0, 180) * longside: The longest side of the oriented rectangle. * shortside: The other side of the oriented rectangle. * Θ: The angle between the longside and the x-axis(The x-axis rotates clockwise).x轴顺时针旋转遇到最长边所经过的角度 

WARNING: IMAGE SIZE MUST MEETS 'HEIGHT = WIDTH'

2.'train.py'

  • All same as ultralytics/yolov5. You better train demo files first before train your custom dataset.
  • Single GPU training:
$ python train.py --batch-size 4 --device 0 
  • Multi GPU training: DistributedDataParallel Mode
python -m torch.distributed.launch --nproc_per_node 4 train.py --sync-bn --device 0,1,2,3 

train_batch_mosaic0train_batch_mosaic1train_batch_mosaic2

3.'detect.py'

  • Download the demo files.
  • Then run the demo. Visualize the detection result and get the result txt files.
$ python detect.py 

detection_result_before_merge1detection_result_before_merge2draw_detection_result

4.'evaluation.py'

  • Run the detect.py demo first. Then change the path with yours:
evaluation ( detoutput=r'/....../DOTA_demo_view/detection', imageset=r'/....../DOTA_demo_view/row_images', annopath=r'/....../DOTA_demo_view/row_DOTA_labels/{:s}.txt' ) draw_DOTA_image ( imgsrcpath=r'/...../DOTA_demo_view/row_images', imglabelspath=r'/....../DOTA_demo_view/detection/result_txt/result_merged', dstpath=r'/....../DOTA_demo_view/detection/merged_drawed' ) 
  • Run the evaluation.py demo. Get the evaluation result and visualize the detection result which after merged.
$ python evaluation.py 

detection_result_after_merge

有问题反馈

在使用中有任何问题,欢迎反馈给我,可以用以下联系方式跟我交流

  • 知乎(@略略略
  • 代码问题提issues,其他问题请知乎上联系

感激

感谢以下的项目,排名不分先后

后续工作

借用moblieNetv2思想,改变backbone部分,实现轻量化网络,减少计算量和参数量 待续..

About

Detecting rotation frame of remote sensing image;Separable convolution

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published