diff --git a/backend/src/InterpolateArchs/RIFE/rife413IFNET.py b/backend/src/InterpolateArchs/RIFE/rife413IFNET.py index a24f0a73..bd12c0c1 100644 --- a/backend/src/InterpolateArchs/RIFE/rife413IFNET.py +++ b/backend/src/InterpolateArchs/RIFE/rife413IFNET.py @@ -2,10 +2,8 @@ import torch.nn as nn import math -try: - from .interpolate import interpolate -except ImportError: - from torch.nn.functional import interpolate + +from torch.nn.functional import interpolate def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dilation=1): @@ -106,7 +104,7 @@ def __init__(self, in_planes, c=64): ResConv(c), ) self.lastconv = nn.Sequential( - nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), MyPixelShuffle(2) + nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), nn.PixelShuffle(2) ) def forward(self, x, flow=None, scale=1): diff --git a/backend/src/InterpolateArchs/RIFE/rife420IFNET.py b/backend/src/InterpolateArchs/RIFE/rife420IFNET.py index 3f2f985f..6230e899 100644 --- a/backend/src/InterpolateArchs/RIFE/rife420IFNET.py +++ b/backend/src/InterpolateArchs/RIFE/rife420IFNET.py @@ -1,10 +1,8 @@ import torch import torch.nn as nn -try: - from .interpolate import interpolate -except ImportError: - from torch.nn.functional import interpolate + +from torch.nn.functional import interpolate def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dilation=1): @@ -105,7 +103,7 @@ def __init__(self, in_planes, c=64): ResConv(c), ) self.lastconv = nn.Sequential( - nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), MyPixelShuffle(2) + nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), nn.PixelShuffle(2) ) def forward(self, x, flow=None, scale=1): diff --git a/backend/src/InterpolateArchs/RIFE/rife421IFNET.py b/backend/src/InterpolateArchs/RIFE/rife421IFNET.py index f0f2c942..e3f8fed5 100644 --- a/backend/src/InterpolateArchs/RIFE/rife421IFNET.py +++ b/backend/src/InterpolateArchs/RIFE/rife421IFNET.py @@ -1,10 +1,8 @@ import torch import torch.nn as nn -try: - from .interpolate import interpolate -except ImportError: - from torch.nn.functional import interpolate + +from torch.nn.functional import interpolate class MyPixelShuffle(nn.Module): @@ -92,7 +90,7 @@ def __init__(self, in_planes, c=64): nn.ConvTranspose2d( in_channels=c, out_channels=4 * 13, kernel_size=4, stride=2, padding=1 ), - MyPixelShuffle(upscale_factor=2), + nn.PixelShuffle(upscale_factor=2), ) self.in_planes = in_planes diff --git a/backend/src/InterpolateArchs/RIFE/rife422_liteIFNET.py b/backend/src/InterpolateArchs/RIFE/rife422_liteIFNET.py index 1185e067..0f5d33a9 100644 --- a/backend/src/InterpolateArchs/RIFE/rife422_liteIFNET.py +++ b/backend/src/InterpolateArchs/RIFE/rife422_liteIFNET.py @@ -1,10 +1,8 @@ import torch import torch.nn as nn -try: - from .interpolate import interpolate -except ImportError: - from torch.nn.functional import interpolate + +from torch.nn.functional import interpolate class MyPixelShuffle(nn.Module): diff --git a/backend/src/InterpolateArchs/RIFE/rife46IFNET.py b/backend/src/InterpolateArchs/RIFE/rife46IFNET.py index c59b8b7d..032dfa21 100644 --- a/backend/src/InterpolateArchs/RIFE/rife46IFNET.py +++ b/backend/src/InterpolateArchs/RIFE/rife46IFNET.py @@ -2,10 +2,8 @@ import torch.nn as nn import torch.nn.functional as F -try: - from .interpolate import interpolate -except ImportError: - from torch.nn.functional import interpolate + +from torch.nn.functional import interpolate from .warplayer import warp @@ -72,7 +70,7 @@ def __init__(self, in_planes, c=64): ResConv(c), ) self.lastconv = nn.Sequential( - nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), MyPixelShuffle(2) + nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), nn.PixelShuffle(2) ) def forward(self, x, flow=None, scale=1): diff --git a/backend/src/InterpolateArchs/RIFE/rife47IFNET.py b/backend/src/InterpolateArchs/RIFE/rife47IFNET.py index 7de0384f..5286c4be 100644 --- a/backend/src/InterpolateArchs/RIFE/rife47IFNET.py +++ b/backend/src/InterpolateArchs/RIFE/rife47IFNET.py @@ -2,10 +2,8 @@ import torch.nn as nn import math -try: - from .interpolate import interpolate -except ImportError: - from torch.nn.functional import interpolate + +from torch.nn.functional import interpolate def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dilation=1): @@ -106,7 +104,7 @@ def __init__(self, in_planes, c=64): ResConv(c), ) self.lastconv = nn.Sequential( - nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), MyPixelShuffle(2) + nn.ConvTranspose2d(c, 4 * 6, 4, 2, 1), nn.PixelShuffle(2) ) def forward(self, x, flow=None, scale=1):