Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Fix align_corners warnings and fix flickering issue #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def forward(self, x, skpCn):
"""

# Bilinear interpolation with scaling 2.
x = F.interpolate(x, scale_factor=2, mode='bilinear')
x = F.interpolate(x, scale_factor=2, mode='bilinear', align_corners=True)
# Convolution + Leaky ReLU
x = F.leaky_relu(self.conv1(x), negative_slope = 0.1)
# Convolution + Leaky ReLU on (`x`, `skpCn`)
Expand Down Expand Up @@ -281,7 +281,7 @@ def forward(self, img, flow):
# stacking X and Y
grid = torch.stack((x,y), dim=3)
# Sample pixels using bilinear interpolation.
imgOut = torch.nn.functional.grid_sample(img, grid)
imgOut = torch.nn.functional.grid_sample(img, grid, align_corners=True)
return imgOut


Expand Down