mirror of
https://github.com/hzwer/ECCV2022-RIFE.git
synced 2025-12-16 08:27:45 +01:00
Update IFNet_HDv2.py
This commit is contained in:
@@ -25,19 +25,20 @@ class IFBlock(nn.Module):
|
|||||||
def __init__(self, in_planes, scale=1, c=64):
|
def __init__(self, in_planes, scale=1, c=64):
|
||||||
super(IFBlock, self).__init__()
|
super(IFBlock, self).__init__()
|
||||||
self.scale = scale
|
self.scale = scale
|
||||||
self.conv0 = conv(in_planes, c, 5, 2, 2)
|
self.conv0 = nn.Sequential(
|
||||||
|
conv(in_planes, c, 3, 2, 1),
|
||||||
|
conv(c, 2*c, 3, 2, 1),
|
||||||
|
)
|
||||||
self.convblock = nn.Sequential(
|
self.convblock = nn.Sequential(
|
||||||
conv(c, c),
|
conv(2*c, 2*c),
|
||||||
conv(c, c),
|
conv(2*c, 2*c),
|
||||||
conv(c, c),
|
conv(2*c, 2*c),
|
||||||
conv(c, c),
|
conv(2*c, 2*c),
|
||||||
conv(c, c),
|
conv(2*c, 2*c),
|
||||||
conv(c, c),
|
conv(2*c, 2*c),
|
||||||
conv(c, c),
|
|
||||||
conv(c, c),
|
|
||||||
)
|
)
|
||||||
self.conv1 = nn.Conv2d(c, 4, 3, 1, 1)
|
self.conv1 = nn.ConvTranspose2d(2*c, 4, 4, 2, 1)
|
||||||
|
|
||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
if self.scale != 1:
|
if self.scale != 1:
|
||||||
x = F.interpolate(x, scale_factor=1. / self.scale, mode="bilinear",
|
x = F.interpolate(x, scale_factor=1. / self.scale, mode="bilinear",
|
||||||
|
|||||||
Reference in New Issue
Block a user