旋转框目标检测mmrotate v0.3.1入门

1、旋转目标监测的定义

受益于通用物体检测的蓬勃发展,目前大多数旋转物体检测模型都是基于经典的通用物体检测模型。随着检测任务的发展,水平箱已经不能满足某些细分领域研究人员的需求。通过重新定义对象表示,增加回归自由度,实现旋转矩形、四边形,甚至任意形状的检测,我们称之为旋转对象检测

2、什么是旋转的盒子

旋转对象检测与通用检测最显著的区别是用旋转的框标注替换了水平框标注。它们的定义如下:

Horizontal box: A rectangle with the width along the x-axis and height
along the y-axis. Usually, it can be represented by the coordinates of
2 diagonal vertices (x_i, y_i) (i = 1, 2), or it can be represented by
the coordinates of the center point and the width and height,
(x_center, y_center, width, height).

Rotated box: It is obtained by rotating the horizontal box around the
center point by an angle, and the definition method of its rotated box
is obtained by adding a radian parameter (x_center, y_center, width,
height, theta), where theta = angle * pi / 180. The unit of theta is
rad. When the rotation angle is a multiple of 90°, the rotated box
degenerates into a horizontal box.
The rotated box annotations
exported by the annotation software are usually polygons, which need
to be converted to the rotated box definition method before training

在MMRotate中,角度参数以弧度为单位。

3、Rotation direction(旋转方向)

将水平的盒子围绕中心点顺时针或逆时针旋转,就可以得到一个旋转的盒子。
将水平的盒子围绕中心点顺时针或逆时针旋转,就可以得到一个旋转的盒子。旋转方向与坐标系的选择密切相关。图像空间采用右手坐标系(y, x),其中y为上->下,x为左->右。有两个相反的旋转方向:

3.1顺时针方向(CW)

旋转框目标检测mmrotate v0.3.1入门_第1张图片

旋转框目标检测mmrotate v0.3.1入门_第2张图片

3.2 逆时针(CCW)

旋转框目标检测mmrotate v0.3.1入门_第3张图片
旋转框目标检测mmrotate v0.3.1入门_第4张图片
在MMCV中可以设置旋转方向的算子有:
box_iou_rotated (Defaults to CW)

nms_rotated (Defaults to CW)

RoIAlignRotated (Defaults to CCW)

RiRoIAlignRotated (Defaults to CCW).

MMRotate中,被旋转的盒子的旋转方向为CW。

3、三种选状框定义

由于theta的定义范围不同,在旋转物体检测中,逐渐出现了以下三种旋转盒子的定义:
详细内容参考旋转框目标检测————关于旋转框定义和解决方案

1、Doc’ OpenCV Definition

angle∈(0, 90°], theta∈(0, pi / 2], The angle between the width of the rectangle and the positive semi-axis of x is a positive acute angle. This definition comes from the cv2.minAreaRect function in OpenCV, which returns an angle in the range (0, 90°].

2、Dle 135 Long Edge Definition (135°)

: Long Edge Definition (135°),angle∈[-45°, 135°), theta∈[-pi / 4, 3 * pi / 4) and width > height.

3、Dle90

Long Edge Definition (90°),angle∈[-90°, 90°), theta∈[-pi / 2, pi / 2) and width > height

4、MMRotate组成

旋转框目标检测mmrotate v0.3.1入门_第5张图片

旋转框目标检测mmrotate v0.3.1入门_第6张图片

MMRotate consists of 4 main parts, datasets, models, core and apis.

1、 datasets

is for data loading and data augmentation. In this part, we support various datasets for rotated object detection algorithms, useful data augmentation transforms in pipelines for pre-processing image.
用于数据加载和数据增强。在这部分中,我们支持旋转对象检测算法的各种数据集,这是图像预处理管道中有用的数据增强变换。

2、models

contains models and loss functions.
包含模型和损失函数。

3、core

provides evaluation tools for model training and evaluation.
提供模型训练和评估的评估工具。

4、apis

provides high-level APIs for models training, testing, and inference.
为模型训练、测试和推断提供高级api。

旋转框目标检测mmrotate v0.3.1入门_第7张图片

detecror

旋转框目标检测mmrotate v0.3.1入门_第8张图片

neck

旋转框目标检测mmrotate v0.3.1入门_第9张图片

rpn head

旋转框目标检测mmrotate v0.3.1入门_第10张图片

roi_head

旋转框目标检测mmrotate v0.3.1入门_第11张图片

bbox_head

旋转框目标检测mmrotate v0.3.1入门_第12张图片

loss

旋转框目标检测mmrotate v0.3.1入门_第13张图片

Assigner

旋转框目标检测mmrotate v0.3.1入门_第14张图片
MaxConvexIoUAssigner:为每个框分配相应的gt框或背景。每一个提议将被分配为’ -1 ',或一个半正整数表示地面真实指数。

-1:阴性样本,未分配gt
-半正整数:正样本,分配的gt的索引(基于0开始)
Samplers(随机取样器)

旋转框目标检测mmrotate v0.3.1入门_第15张图片

post_processing(nms)

旋转框目标检测mmrotate v0.3.1入门_第16张图片

iou_calculator

旋转框目标检测mmrotate v0.3.1入门_第17张图片

注意

由于旋转框的定义不同,需要注意以下几点:

Loading annotations

Data augmentation

Assigning samples

Evaluation

你可能感兴趣的:(MMroteate,目标检测,人工智能,计算机视觉)