Skip to content

Commit

Permalink
experimental performance changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Aug 27, 2024
1 parent 66f6eaf commit e34421b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 29 deletions.
8 changes: 3 additions & 5 deletions backend/src/InterpolateArchs/RIFE/rife413IFNET.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
8 changes: 3 additions & 5 deletions backend/src/InterpolateArchs/RIFE/rife420IFNET.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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):
Expand Down
8 changes: 3 additions & 5 deletions backend/src/InterpolateArchs/RIFE/rife421IFNET.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions backend/src/InterpolateArchs/RIFE/rife422_liteIFNET.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
8 changes: 3 additions & 5 deletions backend/src/InterpolateArchs/RIFE/rife46IFNET.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down
8 changes: 3 additions & 5 deletions backend/src/InterpolateArchs/RIFE/rife47IFNET.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e34421b

Please sign in to comment.