jbwang1997 / OBBDetection

OBBDetection is an oriented object detection library, which is based on MMdetection.
Apache License 2.0
520 stars 111 forks source link

是否支持在线多尺度训练和多尺度测试呢? #150

Open LiaoYujia opened 2 years ago

LiaoYujia commented 2 years ago

目前遥感数据集,以DOTA数据集为例一般是离线多尺度裁图,裁成[0.5,1.0,1.5]三种尺度,在训练时统一resize到1024*1024,OBBDetection框架也实现了这种方式,很好用。但是最近在实现在线多尺度训练和测试的时候遇到问题,想问问OBBDetection实现了在线多尺度训练和在线多尺度测试吗?如果实现了的话,如何使用呢? 希望能得到您的帮助。

下面是我实现在线多尺度训练和 在线多尺度测试的方式: 在线多尺度训练: train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadOBBAnnotations', with_bbox=True, with_label=True, obb_as_mask=True), dict(type='LoadDOTASpecialInfo'), dict(type='Resize', img_scale=[(1024, 1024),(1536,1536)], multiscale_mode='range', keep_ratio=True),..... 能够运行 在线多尺度测试: test_pipeline = [ dict(type='LoadImageFromFile'), dict( type='MultiScaleFlipRotateAug', img_scale=[(1024, 1024),(1536,1536)], h_flip=False, v_flip=False, rotate=False, transforms=[ dict(type='Resize', keep_ratio=True), dict(type='OBBRandomFlip'), dict(type='Normalize', **img_norm_cfg), dict(type='RandomOBBRotate', rotate_after_flip=True), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), dict(type='OBBCollect', keys=['img']), ]) ] 改变了 img_scale 的输入,出现维度不匹配的情况。