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

    在这里插入图片描述

    注意

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

    Loading annotations

    Data augmentation

    Assigning samples

    Evaluation

  • 相关阅读:
    零代码编程:用ChatGPT批量采集bookroo网页上的英文书目列表
    JUnit进行单元测试
    Go定时器使用
    vlookup查找匹配值超过255个字符显示#Value的解决办法
    含稀土铕双功能荧光磁性纳米粒子/包裹磁性稀土荧光复合物纳米微球的性能与表征
    探究map为什么不能遍历的同时进行增删操作
    【计算机网络笔记六】应用层(三)HTTP 的 Cookie、缓存控制、代理服务、短连接和长连接
    【MySQL知识点】默认约束、非空约束
    聊一聊国内大模型公司,大模型面试心得、经验、感受
    LeetCode 454 四数相加II 383. 赎金信 15. 三数之和 18. 四数之和
  • 原文地址:https://blog.csdn.net/qq_41627642/article/details/125506315