Skip to content

Commit

Permalink
fix edvr (PaddlePaddle#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangna11BD authored Oct 19, 2021
1 parent a95ce33 commit 42f390d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 216 deletions.
23 changes: 10 additions & 13 deletions ppgan/models/generators/edvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import paddle

import numpy as np

import paddle
import paddle.nn as nn
from ...modules.init import kaiming_normal_, constant_, constant_init
from paddle.vision.ops import DeformConv2D

from ...modules.dcn import DeformableConv_dygraph
# from paddle.vision.ops import DeformConv2D #to be compiled
from ...modules.init import kaiming_normal_, constant_, constant_init

from .builder import GENERATORS

Expand Down Expand Up @@ -373,14 +371,13 @@ def __init__(self,
self.total_channels = self.deformable_groups * 3 * self.kernel_size[
0] * self.kernel_size[1]
self.split_channels = self.total_channels // 3
self.dcn = DeformableConv_dygraph(
num_filters=self.num_filters,
filter_size=self.kernel_size,
dilation=dilation,
stride=stride,
padding=padding,
deformable_groups=self.deformable_groups)
# self.dcn = DeformConv2D(in_channels=self.num_filters,out_channels=self.num_filters,kernel_size=self.kernel_size,stride=stride,padding=padding,dilation=dilation,deformable_groups=self.deformable_groups,groups=1) # to be compiled
self.dcn = DeformConv2D(in_channels=self.num_filters,
out_channels=self.num_filters,
kernel_size=self.kernel_size,
stride=stride,
padding=padding,
dilation=dilation,
deformable_groups=self.deformable_groups)
self.sigmoid = nn.Sigmoid()
# init conv offset
constant_init(self.conv_offset_mask, 0., 0.)
Expand Down
12 changes: 3 additions & 9 deletions ppgan/models/generators/mpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import paddle

import numpy as np

import paddle
import paddle.nn as nn
from ...modules.init import kaiming_normal_, constant_
import paddle.nn.functional as F

from ...modules.dcn import DeformableConv_dygraph
# from paddle.vision.ops import DeformConv2D #to be compiled
from ...modules.init import kaiming_normal_, constant_

from .builder import GENERATORS

import paddle
from paddle import nn
import paddle.nn.functional as F


##########################################################################
def conv(in_channels, out_channels, kernel_size, bias_attr=False, stride=1):
Expand Down
194 changes: 0 additions & 194 deletions ppgan/modules/dcn.py

This file was deleted.

0 comments on commit 42f390d

Please sign in to comment.