Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
85361824
P
PaddleGAN
项目概览
PaddlePaddle
/
PaddleGAN
1 年多 前同步成功
通知
97
Star
7254
Fork
1210
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleGAN
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
85361824
编写于
11月 23, 2022
作者:
L
LielinJiang
提交者:
GitHub
11月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix basicvsr export error (#729)
* fix basicvsr * clean code
上级
7557835d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
21 addition
and
1 deletion
+21
-1
ppgan/models/base_model.py
ppgan/models/base_model.py
+1
-0
ppgan/models/generators/basicvsr.py
ppgan/models/generators/basicvsr.py
+20
-1
未找到文件。
ppgan/models/base_model.py
浏览文件 @
85361824
...
@@ -192,6 +192,7 @@ class BaseModel(ABC):
...
@@ -192,6 +192,7 @@ class BaseModel(ABC):
for
i
in
range
(
net
[
"inputs_num"
])
for
i
in
range
(
net
[
"inputs_num"
])
]
]
inputs_num
=
inputs_num
+
net
[
"inputs_num"
]
inputs_num
=
inputs_num
+
net
[
"inputs_num"
]
self
.
nets
[
net
[
"name"
]].
export_mode
=
True
static_model
=
paddle
.
jit
.
to_static
(
self
.
nets
[
net
[
"name"
]],
static_model
=
paddle
.
jit
.
to_static
(
self
.
nets
[
net
[
"name"
]],
input_spec
=
input_spec
)
input_spec
=
input_spec
)
if
output_dir
is
None
:
if
output_dir
is
None
:
...
...
ppgan/models/generators/basicvsr.py
浏览文件 @
85361824
...
@@ -546,6 +546,22 @@ class BasicVSRNet(nn.Layer):
...
@@ -546,6 +546,22 @@ class BasicVSRNet(nn.Layer):
return
flows_forward
,
flows_backward
return
flows_forward
,
flows_backward
def
compute_flow_export
(
self
,
lrs
):
"""export version of compute_flow
"""
n
,
t
,
c
,
h
,
w
=
lrs
.
shape
lrs_1
=
lrs
[:,
:
-
1
,
:,
:,
:].
reshape
([
-
1
,
c
,
h
,
w
])
lrs_2
=
lrs
[:,
1
:,
:,
:,
:].
reshape
([
-
1
,
c
,
h
,
w
])
flows_backward
=
self
.
spynet
(
lrs_1
,
lrs_2
).
reshape
([
n
,
t
-
1
,
2
,
h
,
w
])
flows_forward
=
self
.
spynet
(
lrs_2
,
lrs_1
).
reshape
([
n
,
t
-
1
,
2
,
h
,
w
])
return
flows_forward
,
flows_backward
def
forward
(
self
,
lrs
):
def
forward
(
self
,
lrs
):
"""Forward function for BasicVSR.
"""Forward function for BasicVSR.
...
@@ -566,6 +582,9 @@ class BasicVSRNet(nn.Layer):
...
@@ -566,6 +582,9 @@ class BasicVSRNet(nn.Layer):
self
.
check_if_mirror_extended
(
lrs
)
self
.
check_if_mirror_extended
(
lrs
)
# compute optical flow
# compute optical flow
if
hasattr
(
self
,
'export_mode'
)
and
self
.
export_mode
is
True
:
flows_forward
,
flows_backward
=
self
.
compute_flow_export
(
lrs
)
else
:
flows_forward
,
flows_backward
=
self
.
compute_flow
(
lrs
)
flows_forward
,
flows_backward
=
self
.
compute_flow
(
lrs
)
# backward-time propgation
# backward-time propgation
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录