旋转框目标检测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)

0-------------------> x (0 rad)
|  A-------------B
|  |             |
|  |     box     h
|  |   angle=0   |
|  D------w------C
v
y (pi/2 rad)

在这里插入图片描述

3.2 逆时针(CCW)

在这里插入图片描述
在这里插入图片描述
在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 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。

在这里插入图片描述

detecror

在这里插入图片描述

neck

在这里插入图片描述

rpn head

在这里插入图片描述

roi_head

在这里插入图片描述

bbox_head

在这里插入图片描述

loss

在这里插入图片描述

Assigner

在这里插入图片描述
MaxConvexIoUAssigner:为每个框分配相应的gt框或背景。每一个提议将被分配为’ -1 ',或一个半正整数表示地面真实指数。

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

在这里插入图片描述

post_processing(nms)

在这里插入图片描述

iou_calculator

在这里插入图片描述

注意

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

Loading annotations

Data augmentation

Assigning samples

Evaluation

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
水平旋转目标检测是两种不同的目标检测方法。水平目标检测是指使用传统的矩形来标记和检测目标物体。这种方法适用于大多数常见的物体,因为它们的形状通常是接近矩形的。然而,对于一些特殊的物体,如旋转的物体或非矩形的物体,使用水平可能无法准确地标记和检测目标。 旋转目标检测是一种更灵活的方法,它允许标记和检测旋转的物体或任意形状的物体。通过重新定义对象表示,增加回归自由度,旋转目标检测可以实现对旋转矩形、四边形甚至任意形状的目标的准确标记和检测。这种方法在一些特定的领域研究中非常有用,例如交通标志识别、航空图像分析等。它可以提高目标检测的准确性和鲁棒性,但也增加了算法的复杂性和计算成本。 总之,水平目标检测适用于大多数常见的物体,而旋转目标检测适用于旋转的物体或非矩形的物体。选择哪种方法取决于具体的应用场景和需求。\[1\] #### 引用[.reference_title] - *1* [旋转目标检测mmrotate v0.3.1入门](https://blog.csdn.net/qq_41627642/article/details/125506315)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [七、水平旋转目标检测样本标注,支持VOC、DOTA、glVOC等格式,值得一试](https://blog.csdn.net/julinfn/article/details/121060643)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [旋转目标检测【1】如何设计深度学习模型](https://blog.csdn.net/qq_41204464/article/details/130631935)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值