我是靠谱客的博主 眼睛大犀牛,最近开发中收集的这篇文章主要介绍图像去噪BRDNet pytorch实现,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

paper名称:Image Denoising using Deep CNN with Batch ReNormalization

文章paper在这:https://www.sciencedirect.com/science/article/abs/pii/S0893608019302394
keras实现代码:https://github.com/hellloxiaotian/BRDNet

class BRDNet(nn.Module):
def __init__(self, channels, num_of_layers=15):
super(BRDNet, self).__init__()
kernel_size = 3
padding = 1
features = 64
groups = 1
L = []
layers = []
layers.append(nn.Conv2d(in_channels=channels, out_channels=features, kernel_size=kernel_size, padding=padding,
bias=False))
layers.append(nn.BatchNorm2d(features))
layers.append(nn.ReLU(inplace=True))
# layers.append(B.ResBlock(features, features, kernel_size=kernel_size, stride=1, padding=padding, bias=False, mode='CRC', negative_slope=0.2))
for _ in range(15):
layers.append(
nn.Conv2d(in_channels=features, out_channels=features, kernel_size=kernel_size, padding=padding,
bias=False))
layers.append(nn.BatchNorm2d(features))
layers.append(nn.ReLU(inplace=True))
# layers.append(B.ResBlock(features, features, kernel_size=kernel_size, stride=1, padding=padding, bias=False, mode='CRC', negative_slope=0.2))
layers.append(nn.Conv2d(in_channels=features, out_channels=channels, kernel_size=kernel_size, padding=padding,
bias=False))
# 原来out_channels为channels
L = []
L.append(nn.Conv2d(in_channels=channels, out_channels=features, kernel_size=kernel_size, padding=padding,
bias=False))
L.append(nn.BatchNorm2d(features))
L.append(nn.ReLU(inplace=True))
for i in range(7):
L.append(nn.Conv2d(in_channels=features, out_channels=features, kernel_size=kernel_size, padding=2, groups=groups,
bias=False, dilation=2))
L.append(nn.ReLU(inplace=True))
L.append(nn.Conv2d(in_channels=features, out_channels=features, kernel_size=kernel_size, padding=padding,
bias=False))
L.append(nn.BatchNorm2d(features))
L.append(nn.ReLU(inplace=True))
for i in range(6):
L.append(nn.Conv2d(in_channels=features, out_channels=features, kernel_size=kernel_size, padding=2,
groups=groups,bias=False, dilation=2))
L.append(nn.ReLU(inplace=True))
L.append(nn.Conv2d(in_channels=features, out_channels=features, kernel_size=kernel_size, padding=padding,
bias=False))
L.append(nn.BatchNorm2d(features))
L.append(nn.ReLU(inplace=True))
L.append(nn.Conv2d(in_channels=features, out_channels=channels, kernel_size=kernel_size, padding=padding,
bias=False))
self.BRDNet_first = nn.Sequential(*layers)
self.BRDNet_second = nn.Sequential(*L)
self.conv1 = nn.Sequential(
nn.Conv2d(in_channels=channels*2, out_channels=channels, kernel_size=kernel_size, padding=padding,
groups=groups, bias=False))
def forward(self, x):
out1 = self.BRDNet_first(x)
out2 = self.BRDNet_second(x)
out1 = x - out1
out2 = x - out2
out = torch.cat([out1, out2], 1)
out = self.conv1(out)
out = x - out
return out

最后

以上就是眼睛大犀牛为你收集整理的图像去噪BRDNet pytorch实现的全部内容,希望文章能够帮你解决图像去噪BRDNet pytorch实现所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(52)

评论列表共有 0 条评论

立即
投稿
返回
顶部