小波下采样,即插即用

论文:Haar wavelet downsampling: A simple but effective downsampling module

GitHub地址 :https://github.com/apple1986/HWD

论文地址:                                        https://www.sciencedirect.com/science/article/pii/S0031320323005174  

这篇论文利用频域的小波变化来进行降采样,图像经过小波变化会得到1个低频特征A,和3个高频特征H、V、D。常规的下采样操作普遍面临的信息损失问题,应用Haar小波变换来降低特征图的空间分辨率,可以更完整的保留图像的信息。

```import torchimport torch.nn as nnfrom pytorch_wavelets 
import DWTForward
class Down_wt(nn.Module):    
def __init__(self, in_ch, out_ch):        
super(Down_wt, self).__init__()        
self.wt = DWTForward(J=1, mode='zero', wave='haar')        
self.conv_bn_relu = nn.Sequential(            
nn.Conv2d(in_ch * 4, out_ch, kernel_size=1, stride=1),            
nn.BatchNorm2d(out_ch),            
nn.ReLU(inplace=True),        
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值