mmdetection COCO test-dev测试

MMdetection COCO test-dev测试步骤总结

1、修改config文件

data = dict(
    samples_per_gpu=1,
    workers_per_gpu=0,
    train=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_train2017.json',
        img_prefix=data_root + 'train2017/',
        pipeline=train_pipeline),
    val=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/instances_val2017.json',
        img_prefix=data_root + 'val2017/',
        pipeline=test_pipeline),
    test=dict(
        type=dataset_type,
        ann_file=data_root + 'annotations/image_info_test-dev2017.json',
        img_prefix=data_root + 'test2017/',
        pipeline=test_pipeline))

2、测试

python tools/test.py configs/retinanet_x101_fpn_2x.py work_dirs/retinanet_x101_fpn_2x/epoch_24.pth  --format-only --options "jsonfile_prefix=./retinanet_x101_results"

3、多尺度测试

修改config后继续按步骤2操作:

test_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(
        type='MultiScaleFlipAug',
        img_scale=[(800, 480), (1067, 640), (1333, 800), (1600, 960), (1867, 1120), (2133, 1280)],
        flip=True,
        transforms=[
            dict(type='Resize', keep_ratio=True),
            dict(type='RandomFlip'),
            dict(type='Normalize', **img_norm_cfg),
            dict(type='Pad', size_divisor=32),
            dict(type='ImageToTensor', keys=['img']),
            dict(type='Collect', keys=['img']),
        ])
]

4、提交

测试后你会得到一个json文件,将其转为zip文件后,在COCO官网注册后进行提交。2019和2017的test-dev数据集未发生变动,所以直接提交即可,大约10-20分钟出结果,有时比较慢,提交不上多提交两遍即可。
在这里插入图片描述
我在多尺度测试后能够涨点1.3左右,感觉没有想象中的高,如果您能够获得更高的提升,也希望您能和我分享一下trick或者如何更好地设置,感恩!

  • 7
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 13
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值