Orginal project site:
- DOTA dataset:https://captain-whu.github.io/DOTA/dataset.html
- YOLOv5:https://github.com/ultralytics/yolov5
Training models for detecting ships in aerial images.
This project can extract images containing ships that its gsd is greater than 0.1 and less than 0.5 in the DOTA dataset, and crop these aerial images into 800*800 pieces for training.
The recognition effect is as shown above.
- install dependencies
pip install -U -r requirements.txt
- Put training images into
.\data\src\img
,label txt into.\data\src\otxt
- Run
python caijian.py
to crop images into pieces - Run
python train_crop.py
to select images that are ships(or others) - Run
first.py
andvoc_label.py
to Convert dota label format to yolo label format - Modify configs in
.\data\icon.yaml
and.\models\yolov5*.yaml
- Run to train your own model
python train.py --data icon.yaml --cfg yolov5*.yaml --weights yolov5*.pt --batch-size 16
- Use
connect_img.py
to connect cropped images NOTICE: Remember to modify the path in some files.
Run
python detect.py --source ./inference/images/ --weights best.pt --conf 0.4
You can also train a models to recognize the rotation of these ships by using these project below: