mobilenetv2-yolov3修改backbon的多尺度

原始mobilenetv2-yolov3的out_indices=[2,4,6]

neck=dict(
        type='YOLOV3Neck',
        num_scales=3,
        in_channels=[320, 96, 32],
        out_channels=[96, 96, 96]),
    bbox_head=dict(
        type='YOLOV3Head',
        num_classes=3,
        in_channels=[96, 96, 96],
        out_channels=[96, 96, 96],
        anchor_generator=dict(
            type='YOLOAnchorGenerator',
            base_sizes=[[(118,87), (153, 206), (165, 150)],
                        [(30, 61), (120, 87), (120, 175)],
                        [(10, 28), (28, 36), (62, 40)]],
            strides=[32, 16, 8]),

修改out_indices=[1,2,4]

neck=dict(
        type='YOLOV3Neck',
        num_scales=3,
        in_channels=[96, 32, 24],
        out_channels=[192, 64, 48]),
    bbox_head=dict(
        type='YOLOV3Head',
        num_classes=3,
        in_channels=[192, 64, 48],
        out_channels=[96, 32, 24],
        anchor_generator=dict(
            type='YOLOAnchorGenerator',
            base_sizes=[[(118,87), (153, 206), (165, 150)],
                        [(30, 61), (120, 87), (120, 175)],
                        [(10, 28), (28, 36), (62, 40)]],
            strides=[16, 8, 4]),

并修改mobilenet_v2代码中invertedResidual中的padding=1,以防止修改out_indices后导致的数据不匹配问题

你可能感兴趣的:(python)