Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
32dbb01a
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
大约 1 年 前同步成功
通知
282
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
32dbb01a
编写于
12月 29, 2022
作者:
jm_12138
提交者:
GitHub
12月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add deoldify gradio app (#2158)
上级
01740e0e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
3 deletion
+30
-3
modules/image/Image_editing/colorization/deoldify/README.md
modules/image/Image_editing/colorization/deoldify/README.md
+7
-1
modules/image/Image_editing/colorization/deoldify/README_en.md
...es/image/Image_editing/colorization/deoldify/README_en.md
+7
-1
modules/image/Image_editing/colorization/deoldify/module.py
modules/image/Image_editing/colorization/deoldify/module.py
+16
-1
未找到文件。
modules/image/Image_editing/colorization/deoldify/README.md
浏览文件 @
32dbb01a
...
...
@@ -162,6 +162,8 @@
cv2.imwrite('/PATH/TO/SAVE/IMAGE', img)
```
-
### Gradio APP 支持
从 PaddleHub 2.3.1 开始支持使用链接 http://127.0.0.1:8866/gradio/deoldify 在浏览器中访问 deoldify 的 Gradio APP。
## 五、更新历史
...
...
@@ -177,6 +179,10 @@
移除 Fluid API
*
1.2.0
添加 Gradio APP 支持
```
shell
$
hub
install
deoldify
==
1.
1
.0
$
hub
install
deoldify
==
1.
2
.0
```
modules/image/Image_editing/colorization/deoldify/README_en.md
浏览文件 @
32dbb01a
...
...
@@ -161,6 +161,8 @@
cv2.imwrite('/PATH/TO/SAVE/IMAGE', img)
```
-
### Gradio APP support
Starting with PaddleHub 2.3.1, the Gradio APP for deoldify is supported to be accessed in the browser using the link http://127.0.0.1:8866/gradio/deoldify.
## V. Release Note
...
...
@@ -176,6 +178,10 @@
Remove Fluid API
*
1.2.0
Add Gradio APP support
```
shell
$
hub
install
deoldify
==
1.
1
.0
$
hub
install
deoldify
==
1.
2
.0
```
modules/image/Image_editing/colorization/deoldify/module.py
浏览文件 @
32dbb01a
...
...
@@ -33,7 +33,7 @@ from paddlehub.module.module import serving
author
=
"paddlepaddle"
,
author_email
=
""
,
summary
=
"Deoldify is a colorizaton model"
,
version
=
"1.
1
.0"
)
version
=
"1.
2
.0"
)
class
DeOldifyPredictor
(
nn
.
Layer
):
def
__init__
(
self
,
render_factor
:
int
=
32
,
output_path
:
int
=
'output'
,
load_checkpoint
:
str
=
None
):
...
...
@@ -163,3 +163,18 @@ class DeOldifyPredictor(nn.Layer):
results
=
self
.
run_image
(
img
=
images_decode
)
results
=
U
.
cv2_to_base64
(
results
)
return
results
def
create_gradio_app
(
self
):
import
gradio
as
gr
def
inference
(
image
):
img
,
_
=
self
.
predict
(
image
.
name
)
return
img
title
=
"DeOldify"
interface
=
gr
.
Interface
(
inference
,
inputs
=
gr
.
inputs
.
Image
(
type
=
"file"
),
outputs
=
gr
.
outputs
.
Image
(
type
=
"numpy"
),
title
=
title
,
allow_flagging
=
'never'
)
return
interface
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录