upsampling.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:tf-image-segmentation 作者: VittalP 项目源码 文件源码
def upsample_filt(size):
    """
    Make a 2D bilinear kernel suitable for upsampling of the given (h, w) size.
    """
    factor = (size + 1) // 2
    if size % 2 == 1:
        center = factor - 1
    else:
        center = factor - 0.5
    og = np.ogrid[:size, :size]
    return (1 - abs(og[0] - center) / factor) * \
           (1 - abs(og[1] - center) / factor)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号