Yolov5 rotating target detection-remote sensing image detection-UAV rotating target detection-with code and principle

Overview

In order to solve the problem of rotating target detection, researchers have proposed a variety of methods and algorithms. The following are some common rotating target detection methods:

  • Methods based on sliding windows: sliding windows at different scales and angles on the image, and using a classifier to determine whether there is a target in the window. This method is simple and intuitive, but it is computationally intensive and the effect depends on the scale and angle settings of the window.
  • Method based on feature extraction: Use image feature extraction technology, such as SIFT, HOG, CNN, etc., to obtain the feature representation of the target, and then use the classifier to detect the target. This method can handle the rotation changes of the target better, but it has certain requirements on the accuracy and robustness of feature extraction.
  • Methods based on area extraction: use local area information of the image for target detection, such as Selective
    Search, EdgeBoxes, etc. This method has certain robustness under rotation changes of the target, but is sensitive to changes in the shape and scale of the target.
  • Methods based on deep learning: Use deep learning technology, such as convolutional neural network (CNN), recurrent neural network (RNN), etc., to learn the feature representation of the target in the image, and achieve target detection through regression or classification models. This method has achieved significant improvement in rotating target detection, but requires a large amount of annotation data and computing resources.

Introduction

  • YOLOv5 : YOLOv5 is a target detection algorithm based on deep learning. It adopts a lightweight network structure and has fast detection speed and high accuracy.

  • Insert image description here

  • Rotating target detection : Traditional target detection algorithms mainly target targets in horizontal or vertical directions, but in remote sensing images and drone applications, targets often appear at various angles. Therefore, the detection of rotating targets has become an important research direction.

  • Remote sensing image detection : Remote sensing images usually contain a wide range of geographical information, such as buildings, roads, farmland, etc. Using YOLOv5 for remote sensing image detection can quickly and accurately identify these targets, thereby helping applications such as agriculture and urban planning.

  • UAV rotating target detection : During the aerial photography process of the UAV, due to attitude changes and target movement, the captured targets may exist at various angles. Using YOLOv5 for drone rotating target detection can effectively identify the target and perform tracking or other subsequent processing.

  • Data set and training : In order to achieve rotating target detection, a data set of rotating targets needs to be prepared, and YOLOv5 needs to be adjusted and trained accordingly. The dataset can contain target images with various rotation angles and be annotated.

  • Model tuning : For rotating target detection tasks, it may be necessary to make some adjustments to the YOLOv5 model, such as increasing the number of network layers, adjusting the loss function, etc., to improve detection accuracy and robustness.
    Insert image description here

Code installation

Installation requirements:

  • Linux (recommended); Windows (not recommended, please refer to this question if you have difficulty generating utils/nms_rotated_ext.cpython-XX-XX-XX-XX.so)
  • Python 3.7+
  • PyTorch ≥ 1.7
  • CUDA 9.0 or higher

I've tested the following operating systems and software versions:

  • Operating system: Ubuntu 16.04/18.04
  • CUDA:10.0/10.1/10.2/11.3

installation steps:

a. Create a conda virtual environment and activate it, for example:

conda create -n Py39_Torch1.10_cu11.3 python=3.9 -y 
source activate Py39_Torch1.10_cu11.3

b. Make sure your CUDA runtime API version ≤ CUDA driver version. (e.g. 11.3 ≤ 11.4)

nvcc -V
nvidia-smi

c. Follow the official instructions to install PyTorch and torchvision, and ensure that the cudatoolkit version is the same as the CUDA runtime API version, for example:

pip3 install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio==0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
nvcc -V
python

import torch
torch.version.cuda
exit()

pip install -r requirements.txt
cd utils/nms_rotated
python setup.py develop #或"pip install -v -e ."

Run demo

Usage:
    $ python path/to/detect.py --weights yolov5_rotate.pt --source 0  # webcam
                                                             img.jpg  # image
                                                             vid.mp4  # video
                                                             path/  # directory
                                                             path/*.jpg  # glob
                                                             'https://youtu.be/Zgi9g1ksQHc'  # YouTube
                                                             'rtsp://example.com/media.mp4'  # RTSP, RTMP, HTTP stream

Results display

Insert image description here

in conclusion

When choosing a graduation project topic, you need to consider the following factors:

  • Interests and professional direction: Choosing topics that interest you and are in line with your professional direction will allow you to complete your graduation project with more dedication and enthusiasm, and improve your skills in related fields.
  • Practicality and social needs: Choosing a topic with practicality and social needs can make your graduation project have greater practical significance and application prospects.
  • Research difficulty and feasibility: Choosing a topic that has a certain degree of research difficulty, but also has feasibility and possibility of implementation can ensure that you can complete your graduation project and achieve better results.
代码获取、论文指导、作业帮助、毕设达标——qq1309399183
  • Resources and instructors: Choosing a topic with sufficient resources and guidance support will allow you to get better practical and research experience in your graduation project and successfully complete your graduation project.

Guess you like

Origin blog.csdn.net/ALiLiLiYa/article/details/135274751