语义分割学习笔记(三)——SegNet Upsample层解析

本文深入探讨了SegNet模型中的上采样层。内容包括参数设置、特征图大小计算方法,强调了在不同情况下如何确定上采样尺寸以保持一致性。特别指出,当输入图像尺寸非32的整数倍时,需要精确指定上采样大小,以匹配编码阶段池化层的位置信息。此外,还提供了源码分析作为理解的辅助。
摘要由CSDN通过智能技术生成

1 参数设置

message UpsampleParameter {
  // DEPRECATED. No need to specify upsampling scale factors when
  // exact output shape is given by upsample_h, upsample_w parameters.
  optional uint32 scale = 1 [default = 2];
  // DEPRECATED. No need to specify upsampling scale factors when
  // exact output shape is given by upsample_h, upsample_w parameters.
  optional uint32 scale_h = 2;
  // DEPRECATED. No need to specify upsampling scale factors when
  // exact output shape is given by upsample_h, upsample_w parameters.
  optional uint32 scale_w = 3;
  // DEPRECATED. Specify exact output height using upsample_h. This
  // parameter only works when scale is 2
  optional bool pad_out_h = 4 [default = false];
  // DEPRECATED. Specify exact output width using upsample_w. This
  // parameter only works when scale is 2
  optional bool pad_out_w = 5 [default = false];
  optional uint32 upsample_h = 6;
  optional uint32 upsample_w = 7;
}
可设置参数为:
    scale 
    scale_h scale_w
    pad_out_h pad_out_w
    upsample_h upsample_w


2  top层特征图大小计算

(1)先判断是否指定 upsample_hupsample_w,如果指定,大小为指定大小,否则(2)

(2)判断是否指定 scale_h, 如果未指定, scale_h_ = scale_w_ = scale,否则(3)

(3)scale_h_  = scale_h   scale_w_=scale_w

评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值