旋转框目标检测mmrotate v1.0.0rc1 之RTMDet训练DOTA的官方问题解析整理(四)

news2024/10/5 7:49:33
  1. 关于rotated_rtmdet_l-coco_pretrain-3x-dota_ms.py配置文件的batchsize和学习率设置

问题:

回答:

  1. 如何在mmrotate中绘制特征图

问题:

回答:

你好@AllieLan,您可以尝试使用https://github.com/open-mmlab/mmyolo/blob/main/demo/featmap_vis_demo.py

[Feature] oriented reppoints 支持 filter_empty_gt=False 的训练

问题:

回答:

[1.x] RTMDet-R (tiny) 内存不足的 CUDA,具有 24GB VRAM 和 batch_size=1

问题:

回答:

如何在自己的数据集上测试大场景图片?

问题:

回答:

你好@TheGreatTreatsby, 你可以试试https://github.com/CAPTAIN-WHU/DOTA_devkit

请问这个项目中通道的ms+rr和论文中常说的多维度测试和多维度训练有什么区别

问题:

回答:

使用 DOTA V1.0 数据集时 CFA 重新分配过程中的张量不匹配错误

问题:

回答:

如何改变旋转框的定义范围(如何更改旋转框的定义范围)

问题:

回答:

如何获得精度和F1分数

问题:

回答:

在我的例子中,我修改了 eval_map.py 和我的 custumdataset.py

通过在 def eval_rbbox_map 中创建额外的变量来计算

cls_all_tp = np.sum(tp) cls_all_fp = np.sum(fp)

参考我项目的代码

我的项目

关于 R3Det 中的随机种子 #464

问题:

Question about random seed. #291

为什么相同的物体分类分数相差很大? #455

问题:

回答:

_base_ = ['./roi_trans_r50_fpn_1x_dota_le90.py']

data_root = 'datasets/split_ms_dotav1/'
angle_version = 'le90'
img_norm_cfg = dict(
    mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='LoadAnnotations', with_bbox=True),
    dict(type='RResize', img_scale=(1024, 1024)),
    dict(
        type='RRandomFlip',
        flip_ratio=[0.25, 0.25, 0.25],
        direction=['horizontal', 'vertical', 'diagonal'],
        version=angle_version),
    dict(
        type='PolyRandomRotate',
        rotate_ratio=0.5,
        angles_range=180,
        auto_bound=False,
        rect_classes=[9, 11],
        version=angle_version),
    dict(type='Normalize', **img_norm_cfg),
    dict(type='Pad', size_divisor=32),
    dict(type='DefaultFormatBundle'),
    dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
]
data = dict(
    train=dict(
        pipeline=train_pipeline,
        ann_file=data_root + 'trainval/annfiles/',
        img_prefix=data_root + 'trainval/images/'),
    val=dict(
        ann_file=data_root + 'trainval/annfiles/',
        img_prefix=data_root + 'trainval/images/'),
    test=dict(
        ann_file=data_root + 'test/images/',
        img_prefix=data_root + 'test/images/'))

model = dict(train_cfg=dict(rpn=dict(assigner=dict(gpu_assign_thr=200))))

检测细长物体的困难 #384

问题:

回答:

def gen_single_level_base_anchors(self,
                                      base_size,
                                      scales,
                                      ratios,
                                      center=None):
        """Generate base anchors of a single level.
        Args:
            base_size (int | float): Basic size of an anchor.
            scales (torch.Tensor): Scales of the anchor.
            ratios (torch.Tensor): The ratio between between the height
                and width of anchors in a single level.
            center (tuple[float], optional): The center of the base anchor
                related to a single feature grid. Defaults to None.
        Returns:
            torch.Tensor: Anchors in a single-level feature maps.
        """
        w = base_size
        h = base_size
        if center is None:
            x_center = self.center_offset * w
            y_center = self.center_offset * h
        else:
            x_center, y_center = center

        h_ratios = torch.sqrt(ratios)
        w_ratios = 1 / h_ratios
        if self.scale_major:
            ws = (w * w_ratios[:, None] * scales[None, :]).view(-1)
            hs = (h * h_ratios[:, None] * scales[None, :]).view(-1)
        else:
            ws = (w * scales[:, None] * w_ratios[None, :]).view(-1)
            hs = (h * scales[:, None] * h_ratios[None, :]).view(-1)

        # use float anchor and the anchor's center is aligned with the
        # pixel center
        base_anchors = [
            x_center - 0.5 * ws, y_center - 0.5 * hs, x_center + 0.5 * ws,
            y_center + 0.5 * hs
        ]
        base_anchors = torch.stack(base_anchors, dim=-1)

        return base_anchors

HRSC2016 数据集性能重新实现 #202

问题:

回答:

_base_ = [
    '../_base_/datasets/hrsc.py', '../_base_/schedules/schedule_3x.py',
    '../_base_/default_runtime.py'
]

angle_version = 'le90'
model = dict(
    type='ReDet',
    backbone=dict(
        type='ReResNet',
        depth=50,
        num_stages=4,
        out_indices=(0, 1, 2, 3),
        frozen_stages=1,
        style='pytorch',
        pretrained='./work_dirs/re_resnet50_c8_batch256-25b16846.pth'),
    neck=dict(
        type='ReFPN',
        in_channels=[256, 512, 1024, 2048],
        out_channels=256,
        num_outs=5),
    rpn_head=dict(
        type='RotatedRPNHead',
        in_channels=256,
        feat_channels=256,
        version=angle_version,
        anchor_generator=dict(
            type='AnchorGenerator',
            scales=[8],
            ratios=[0.5, 1.0, 2.0],
            strides=[4, 8, 16, 32, 64]),
        bbox_coder=dict(
            type='DeltaXYWHBBoxCoder',
            target_means=[.0, .0, .0, .0],
            target_stds=[1.0, 1.0, 1.0, 1.0]),
        loss_cls=dict(
            type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
        loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0)),
    roi_head=dict(
        type='RoITransRoIHead',
        version=angle_version,
        num_stages=2,
        stage_loss_weights=[1, 1],
        bbox_roi_extractor=[
            dict(
                type='SingleRoIExtractor',
                roi_layer=dict(
                    type='RoIAlign', output_size=7, sampling_ratio=0),
                out_channels=256,
                featmap_strides=[4, 8, 16, 32]),
            dict(
                type='RotatedSingleRoIExtractor',
                roi_layer=dict(
                    type='RiRoIAlignRotated',
                    out_size=7,
                    num_samples=2,
                    num_orientations=8,
                    clockwise=True),
                out_channels=256,
                featmap_strides=[4, 8, 16, 32]),
        ],
        bbox_head=[
            dict(
                type='RotatedShared2FCBBoxHead',
                in_channels=256,
                fc_out_channels=1024,
                roi_feat_size=7,
                num_classes=1,
                bbox_coder=dict(
                    type='DeltaXYWHAHBBoxCoder',
                    angle_range=angle_version,
                    norm_factor=2,
                    edge_swap=True,
                    target_means=[0., 0., 0., 0., 0.],
                    target_stds=[0.1, 0.1, 0.2, 0.2, 0.1]),
                reg_class_agnostic=True,
                loss_cls=dict(
                    type='CrossEntropyLoss',
                    use_sigmoid=False,
                    loss_weight=1.0),
                loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
                               loss_weight=1.0)),
            dict(
                type='RotatedShared2FCBBoxHead',
                in_channels=256,
                fc_out_channels=1024,
                roi_feat_size=7,
                num_classes=1,
                bbox_coder=dict(
                    type='DeltaXYWHAOBBoxCoder',
                    angle_range=angle_version,
                    norm_factor=None,
                    edge_swap=True,
                    proj_xy=True,
                    target_means=[0., 0., 0., 0., 0.],
                    target_stds=[0.05, 0.05, 0.1, 0.1, 0.05]),
                reg_class_agnostic=False,
                loss_cls=dict(
                    type='CrossEntropyLoss',
                    use_sigmoid=False,
                    loss_weight=1.0),
                loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
        ]),
    train_cfg=dict(
        rpn=dict(
            assigner=dict(
                type='MaxIoUAssigner',
                pos_iou_thr=0.7,
                neg_iou_thr=0.3,
                min_pos_iou=0.3,
                match_low_quality=True,
                ignore_iof_thr=-1),
            sampler=dict(
                type='RandomSampler',
                num=256,
                pos_fraction=0.5,
                neg_pos_ub=-1,
                add_gt_as_proposals=False),
            allowed_border=0,
            pos_weight=-1,
            debug=False),
        rpn_proposal=dict(
            nms_pre=2000,
            max_per_img=2000,
            nms=dict(type='nms', iou_threshold=0.7),
            min_bbox_size=0),
        rcnn=[
            dict(
                assigner=dict(
                    type='MaxIoUAssigner',
                    pos_iou_thr=0.5,
                    neg_iou_thr=0.5,
                    min_pos_iou=0.5,
                    match_low_quality=False,
                    ignore_iof_thr=-1,
                    iou_calculator=dict(type='BboxOverlaps2D')),
                sampler=dict(
                    type='RandomSampler',
                    num=512,
                    pos_fraction=0.25,
                    neg_pos_ub=-1,
                    add_gt_as_proposals=True),
                pos_weight=-1,
                debug=False),
            dict(
                assigner=dict(
                    type='MaxIoUAssigner',
                    pos_iou_thr=0.5,
                    neg_iou_thr=0.5,
                    min_pos_iou=0.5,
                    match_low_quality=False,
                    ignore_iof_thr=-1,
                    iou_calculator=dict(type='RBboxOverlaps2D')),
                sampler=dict(
                    type='RRandomSampler',
                    num=512,
                    pos_fraction=0.25,
                    neg_pos_ub=-1,
                    add_gt_as_proposals=True),
                pos_weight=-1,
                debug=False)
        ]),
    test_cfg=dict(
        rpn=dict(
            nms_pre=2000,
            max_per_img=2000,
            nms=dict(type='nms', iou_threshold=0.7),
            min_bbox_size=0),
        rcnn=dict(
            nms_pre=2000,
            min_bbox_size=0,
            score_thr=0.05,
            nms=dict(iou_thr=0.1),
            max_per_img=2000)))

img_norm_cfg = dict(
    mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(type='LoadAnnotations', with_bbox=True),
    dict(type='RResize', img_scale=(800, 512)),
    dict(type='RRandomFlip', flip_ratio=0.5),
    dict(type='Normalize', **img_norm_cfg),
    dict(type='Pad', size_divisor=32),
    dict(type='DefaultFormatBundle'),
    dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
]
test_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(
        type='MultiScaleFlipAug',
        img_scale=(800, 512),
        flip=False,
        transforms=[
            dict(type='RResize'),
            dict(type='Normalize', **img_norm_cfg),
            dict(type='Pad', size_divisor=32),
            dict(type='DefaultFormatBundle'),
            dict(type='Collect', keys=['img'])
        ])
]

dataset_type = 'HRSCDataset'
data_root = '/data/dataset_share/HRSC2016/HRSC2016/'
data = dict(
    samples_per_gpu=2,
    workers_per_gpu=2,
    train=dict(
        type=dataset_type,
        classwise=False,
        ann_file=data_root + 'ImageSets/trainval.txt',
        ann_subdir=data_root + 'FullDataSet/Annotations/',
        img_subdir=data_root + 'FullDataSet/AllImages/',
        pipeline=train_pipeline),
    val=dict(
        type=dataset_type,
        classwise=False,
        ann_file=data_root + 'ImageSets/test.txt',
        ann_subdir=data_root + 'FullDataSet/Annotations/',
        img_subdir=data_root + 'FullDataSet/AllImages/',
        pipeline=test_pipeline),
    test=dict(
        type=dataset_type,
        classwise=False,
        ann_file=data_root + 'ImageSets/test.txt',
        ann_subdir=data_root + 'FullDataSet/Annotations/',
        img_subdir=data_root + 'FullDataSet/AllImages/',
        pipeline=test_pipeline))

evaluation = dict(interval=12, metric='mAP')
optimizer = dict(lr=0.01)

#原因是问题者的Target_stds和官方不一致,同时学习率也不一致导致的,官方也是使用单张GPU进行模型训练的。

问题:

回答:

不同batchsize下s2anet的mAP #59

单个类别训练报错

问题:

回答:

HRSC2016 的 classwise 设置为 True 时,在评估时出现“IndexError: tuple index out of range”。 #182

尝试结合 swin-Transform 和 s2anet #217

问题:

_base_ = ['./s2anet_r50_fpn_1x_dota_le135.py']

pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth'  # noqa

model = dict(
    backbone=dict(
        _delete_=True,
        type='SwinTransformer',
        embed_dims=96,
        depths=[2, 2, 6, 2],
        num_heads=[3, 6, 12, 24],
        window_size=7,
        mlp_ratio=4,
        qkv_bias=True,
        qk_scale=None,
        drop_rate=0.,
        attn_drop_rate=0.,
        drop_path_rate=0.2,
        patch_norm=True,
        out_indices=(0, 1, 2, 3),
        with_cp=False,
        convert_weights=True,
        init_cfg=dict(type='Pretrained', checkpoint=pretrained)),
    neck=dict(
        _delete_=True,
        type='FPN',
        in_channels=[96, 192, 384, 768],
        out_channels=256,
        num_outs=5))

optimizer = dict(
    _delete_=True,
    type='AdamW',
    lr=0.0001,
    betas=(0.9, 0.999),
    weight_decay=0.05,
    paramwise_cfg=dict(
        custom_keys={
            'absolute_pos_embed': dict(decay_mult=0.),
            'relative_position_bias_table': dict(decay_mult=0.),
            'norm': dict(decay_mult=0.)
        }))

数据标签过多次显示会爆炸、预测后不出指标结果;当数据标签过多时,显存会爆,预测后指标结果不显示; #333

一个对象在 oriented-reppoints 中有两个预测类 #426

[文档]关于lr和batchsize的问题 #645

loss降不下来 #330

如何进行多尺度测试? #201

当我使用 rmosaic 时如何可视化 #686

你好@QAQTATQAQTAT,您可以使用demo/image_demo.py可视化 rmosaic 的输出。rmosaic的使用方法可以参考https://github.com/open-mmlab/mmrotate/blob/dev-1.x/configs/rotated_rtmdet/rotated_rtmdet_tiny-300e-aug-hrsc.py 。

Mosaic( img_scale=(1024, 1024))-> Resize(scale=(2048, 2048))->RandomCrop(crop_size=(1024, 1024))

train_pipeline = [
    dict(
        type='mmdet.LoadImageFromFile',
        file_client_args={{_base_.file_client_args}}),
    dict(type='mmdet.LoadAnnotations', with_bbox=True, box_type='qbox'),
    dict(type='ConvertBoxType', box_type_mapping=dict(gt_bboxes='rbox')),
    dict(
        type='mmdet.CachedMosaic',
        img_scale=(800, 800),
        pad_val=114.0,
        max_cached_images=20,
        random_pop=False),
    dict(
        type='mmdet.RandomResize',
        resize_type='mmdet.Resize',
        scale=(1600, 1600),
        ratio_range=(0.5, 2.0),
        keep_ratio=True),
    dict(type='RandomRotate', prob=0.5, angle_range=180),
    dict(type='mmdet.RandomCrop', crop_size=(800, 800)),
    dict(type='mmdet.YOLOXHSVRandomAug'),
    dict(
        type='mmdet.RandomFlip',
        prob=0.75,
        direction=['horizontal', 'vertical', 'diagonal']),
    dict(type='mmdet.Pad', size=(800, 800), pad_val=dict(img=(114, 114, 114))),
    dict(
        type='mmdet.CachedMixUp',
        img_scale=(800, 800),
        ratio_range=(1.0, 1.0),
        max_cached_images=10,
        random_pop=False,
        pad_val=(114, 114, 114),
        prob=0.5),
    dict(type='mmdet.PackDetInputs')
]

[WIP] 在 TRR360D 中支持 RR360(旋转矩形 360)检测 #731

https://github.com/open-mmlab/mmrotate/pull/731

Oriented RCNN 不支持 iou loss? #649

如何训练宽高比大的物体 #285

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/401662.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java Class 加密工具 ClassFinal

Jar包加密工具 ClassFinal介绍环境依赖使用说明下载加密命令行示例maven插件方式无密码模式机器绑定启动加密后的jar启动参数给密码不加密码参数直接启动1. 密码文件获取2. 交互输入参考资料介绍 ClassFinal 是一款 java class 文件安全加密工具,支持直接加密jar包…

KDHL-600A 回路电阻测试仪

一、产品概述 武汉凯迪正大KDHL-600A回路电阻测试仪是用于测量开关、断路器、变压器等设备的接触电阻、回路电阻的专用测试设备。其采用典型的四线制测量法,通过输出一个直流电流,施加于被测体的两个端钮之间,并测量电流流过被测体所产生的压…

Node.js简介

客户端访问网页时向服务器端发送请求要访问服务器中的页面,服务器收到请求后向数据库中进行搜索,搜索到相关数据然后返回结果给客户端显示; 这个过程就类似于:客人(客户端)去饭馆(服务端&#…

TryHackMe-VulnNet: Active(ez 域渗透)

VulnNet: Active VulnNet Entertainment在他们以前的网络中遇到了不好的时光,该网络遭受了多次破坏。现在,他们移动了整个基础架构,并再次聘请您作为核心渗透测试人员。您的目标是获得对系统的完全访问权限并破坏域。 这应该是我在thm打的最…

Uipath Excel 自动化系列15-Protect Sheet(保护工作表)

活动描述 Protect Sheet(保护工作表):在 Excel 中启用对指定工作表的保护,以便无法对其进行任何其他更改,该活动需与Use Excel File 活动选择的 Excel 文件一起使用。 提示:Protect Sheet活动功能类似Excel文件【审阅】菜单栏下的保护工作簿功能&#…

TencentOS Server 安装 PostgreSQL

TencentOS 简介 2019 年,随着腾讯公司外部客户的需求,以及公司开源协同战略的推进,tlinux 对外开源并进行了品牌升级,升级为 TencentOS Server。TencentOS 包含三大场景,分别如下: TencentOS Server&…

MySQL DQL语句基础(一)

目录 DQL 基本语法 基础查询 1、查询多个字段 2、字段设置别名 3、去除重复记录 条件查询 语法 条件 案例 聚合函数 常见的聚合函数 语法 DQL DQL英文全称是Data Query Language(数据查询语言),数据查询语言,用来查询数据库中表的记录。 基…

java面试-jvm

JVM JVM 是 java 虚拟机,简单来说就是能执行标准 java 字节码的虚拟计算机 JVM 是如何工作的 首先程序在执行之前先要把 Java 代码(.java)转换成字节码(.class),JVM 通过类加载器(ClassLoade…

Linux:创建守护进程,注册信号捕获回调函数,使用shell脚本代码管理守护进程

1.创建守护进程&#xff0c;编译时命名为a.out. 2.在守护进程中注册信号捕捉函数。 3.使用脚本发送自定义信号SIGUSR1给进程a.out。 4.守护进程捕获函数catchSignal&#xff08;&#xff09;捕捉到10号函数SIGUSR1退出进程。 创建守护进程代码&#xff1a; #include <stdi…

第八批国家药品集中采购-(附药品集采目录明细下载)

2023年3月2日&#xff0c;‘国家组织药品联合采购办公室’发出了《全国药品集中采购文件》&#xff0c;宣告了第八批国家组织药品集中采购工作正式开展&#xff0c;其公告中还包含三个附表分别为‘采购品种目录’、‘各地区首年约定采购量’、‘各采购品种首年约定采购量’&…

python for循环中 if else语句缩进对应问题

python for循环中 if else语句缩进对应问题 忙里偷闲&#xff0c;备考计算机二级&#xff0c;发现一个好玩的小知识&#xff0c;想分享一下自己当时的思考以及解决问题的过程 也许点进来的你会莫名其妙&#xff0c;if和else语句的缩进必须对齐&#xff0c;这不是连初学者都一…

【数据结构】带你深入理解栈

一. 栈的基本概念&#x1f4ab;栈是一种特殊的线性表。其只允许在固定的一端进行插入和删除元素的操作&#xff0c;进行数据的插入和删除的一端称作栈顶&#xff0c;另外一端称作栈底。栈不支持随机访问&#xff0c;栈的数据元素遵循后进先出的原则&#xff0c;即LIFO&#xff…

怎么把pdf转换成图片?这个方法你值得拥有

想要高效率的工作&#xff0c;除了需要大家合理安排时间之外&#xff0c;一些能够辅助高效工作的工具也是必不可少的。就拿要把一份pdf文件转换成若干图片来说&#xff0c;如果不知道方法&#xff0c;找不到合适的转换工具&#xff0c;那么想要完成这一任务&#xff0c;势必要花…

万里长征——基础IO

目录 文件常识 回顾C语言的文件操作 系统层面的文件操作 文件操作的本质 文件fd的分配规则及重定向 linux下一切皆文件 详谈缓冲区问题 文件常识 1、文件 文件内容 文件属性 2、空文件也要在磁盘上占据空间。因为空文件虽然内容为空&#xff0c;但它的属性也会占据空…

JVM学习笔记十:执行引擎

0. 前言 声明&#xff1a; 感谢尚硅谷宋红康老师的讲授。 感谢广大网友共享的笔记内容。 B站&#xff1a;https://www.bilibili.com/video/BV1PJ411n7xZ 本文的内容基本来源于宋老师的课件&#xff0c;其中有一些其他同学共享的内容&#xff0c;也有一些自己的理解内容。 1. …

设计模式——工厂方法模式(创建型)

创建型模式提供了创建对象的机制&#xff0c;能够提升已有代码的灵活性和可复用性。一、工厂方法工厂方法模式是一种创建型设计模式&#xff0c;其在父类中提供一个创建对象的方法&#xff0c;允许子类决定实例化对象的类型。问题&#xff1a;假设你正在开发一款物流管理应用。…

STA环境

目录1. CMOS逻辑门2. 波形3. 时钟3.1. 指定时钟create_clock时钟延迟set_clock_latency 时钟不确定度set_clock_uncertainty 跨时钟域set_false_path3.2. 衍生时钟3.3. 虚拟时钟4. 时序路径2.1. 输入路径2.2. 输出路径2.3. 点对点约束本文介绍在执行静态时序分析&#xff08;St…

顺序表的基本操作

目录 一.什么是顺序表 二.顺序表的基本操作 1.初始化 2.增容 3.尾插 4.头插 5.尾删 6.头删 7.指定位置插入 8.指定位置删除 9.打印 10.查找 11.销毁 一.什么是顺序表 顺序表是用一段物理地址连续的存储单元依次存储数据元素的线性结构&#xff0c;一般情况下采用数组…

IBMMQ教程二(window版安装)

下载下载地址&#xff1a;https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/我这里选择的是9.1.0.0版本安装将下载完成的压缩包解压双击Setup.exe直接运行点击软件需求查看系统配置是否满足&#xff0c;右边绿色的对号说明满足需求&#xff0c…

linux 端口查询命令

任何知识都是用进废退&#xff0c;有段时间没摸linux&#xff0c;这大脑里的知识点仿佛全部消失了&#xff0c;就无语。 索性&#xff0c;再写一篇记录&#xff0c;加强一下记忆&#xff0c;下次需要就看自己的资料好了。lsof命令Linux端口查询命令可以通过lsof实现&#xff1a…