jshilong / SEPC

Scale-equalizing Pyramid Convolution for object detection(CVPR2020)
Apache License 2.0
330 stars 56 forks source link

faster rcnn pconv #7

Closed lijain closed 4 years ago

lijain commented 4 years ago

Hello, thank you for sharing. I want to ask you if you test the configuration file settings of faster RCNN to add Pconv, as shown below. model = dict( type='FasterRCNN', pretrained='torchvision://resnet50', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), style='pytorch'),

neck=dict(

#     type='FPN',
#     in_channels=[256, 512, 1024, 2048],
#     out_channels=256,
#     num_outs=5),
neck=[dict(
    type='FPN',
    in_channels=[256, 512, 1024, 2048],
    out_channels=256,
    start_level=1,
    add_extra_convs=True,
    num_outs=5),
    dict(
        type='SEPC',
        out_channels=256,
        Pconv_num=4,
        pconv_deform=False,
        lcconv_deform=False,
        iBN=False,
    )
],
rpn_head=dict(
    type='RPNHead',
    in_channels=256,
    feat_channels=256,
    anchor_scales=[8],
    anchor_ratios=[0.5, 1.0, 2.0],
    anchor_strides=[4, 8, 16, 32, 64],
    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)),
bbox_roi_extractor=dict(
    type='SingleRoIExtractor',
    roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
    out_channels=256,
    featmap_strides=[4, 8, 16, 32]),
bbox_head=dict(
    type='SharedFCBBoxHead',
    num_fcs=2,
    in_channels=256,
    fc_out_channels=1024,
    roi_feat_size=7,
    num_classes=81,
    target_means=[0., 0., 0., 0.],
    target_stds=[0.1, 0.1, 0.2, 0.2],
    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)))
jshilong commented 4 years ago

If you want use it in two stage detector, you change the https://github.com/jshilong/SEPC/blob/51e24ace1653cba6d3bc0ab536c6adb3b956c8dd/sepc/self_mmdet/models/necks/sepc.py#L59 delete L59~L65 ,and just return x

lijain commented 4 years ago

Thank you for your reply, so just save the 4 stages of Pconv!
Would you like to know if you have tried spec in two stages? What's the effect?

jshilong commented 4 years ago

We did't try it considering the latency.

lijain commented 4 years ago

OK, thank you for your reply