yolov3与SSD区别

本文对比了YOLOv3和SSD两种目标检测算法的差异,包括特征混合方式、loss函数、anchor选择、输入分辨率以及目标框的回归方式。YOLOv3采用多尺度特征混合并直接在配置文件中指定anchor大小,而SSD则使用不同的特征层直接接Box Head,其anchor是基于aspect_ratios计算得出。此外,YOLOv3进行多尺度训练,SSD则预测每个默认框的偏移和宽高。
摘要由CSDN通过智能技术生成

参考自
https://github.com/lufficc/SSD
https://github.com/eriklindernoren/PyTorch-YOLOv3
https://blog.csdn.net/BlowfishKing/article/details/80485006
https://zhuanlan.zhihu.com/p/63630903

1.对于特征的混合

首先看SSD的模型

class SSDDetector(nn.Module):
    def __init__(self, cfg):
        super().__init__()
        self.cfg = cfg
        self.backbone = build_backbone(cfg)
        self.box_head = build_box_head(cfg)

    def forward(self, images, targets=None):
        features = self.backbone(images)
        detections, detector_losses = self.box_head(features, targets)
        if self.training:
            return detector_losses
        return detections

backbone以后直接接box_head了

看一下box_hea.py的代码

def cls_block(self, level, out_channels, boxes_per_location):
        return nn.Conv2d(out_channels, boxes_per_location * self.cfg.MODEL.NUM_CLASSES, kernel_size=3, stride=1, padding=1)

    def reg_block(self, level, out_channels, boxes_per_location):
        return nn.Conv2d(out_channels, boxes_per_location * 4, kernel_size=3, stride=1, padding=1)

直接接头了,并没有做多尺度特征混合

再看一下YOLO V3的模型

 elif module_def["type"] == "route":
            layers = [int(x) for x in module_def["layers"].split(",")]
            filters = sum([output_filters[1:][i] for i in layers])
            modules.add_module(f"route_{module_i}", EmptyLayer())
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值