Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
c48d8210
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
接近 2 年 前同步成功
通知
284
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看板
提交
c48d8210
编写于
3月 14, 2022
作者:
C
chenjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify model name
上级
6af4bec3
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
10 addition
and
10 deletion
+10
-10
modules/image/Image_gan/style_transfer/paint_transformer/README.md
...mage/Image_gan/style_transfer/paint_transformer/README.md
+8
-8
modules/image/Image_gan/style_transfer/paint_transformer/brush/brush_large_horizontal.png
...ansfer/paint_transformer/brush/brush_large_horizontal.png
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/brush/brush_large_vertical.png
...transfer/paint_transformer/brush/brush_large_vertical.png
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/inference.py
...e/Image_gan/style_transfer/paint_transformer/inference.py
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/model.py
...image/Image_gan/style_transfer/paint_transformer/model.py
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/module.py
...mage/Image_gan/style_transfer/paint_transformer/module.py
+2
-2
modules/image/Image_gan/style_transfer/paint_transformer/render_parallel.py
...e_gan/style_transfer/paint_transformer/render_parallel.py
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/render_serial.py
...age_gan/style_transfer/paint_transformer/render_serial.py
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/render_utils.py
...mage_gan/style_transfer/paint_transformer/render_utils.py
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/requirements.txt
...age_gan/style_transfer/paint_transformer/requirements.txt
+0
-0
modules/image/Image_gan/style_transfer/paint_transformer/util.py
.../image/Image_gan/style_transfer/paint_transformer/util.py
+0
-0
未找到文件。
modules/image/Image_gan/style_transfer/painttransformer/README.md
→
modules/image/Image_gan/style_transfer/paint
_
transformer/README.md
浏览文件 @
c48d8210
# painttransformer
# paint
_
transformer
|模型名称|painttransformer|
|模型名称|paint
_
transformer|
| :--- | :---: |
| :--- | :---: |
|类别|图像 - 风格转换|
|类别|图像 - 风格转换|
|网络|Paint Transformer|
|网络|Paint Transformer|
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
-
### 2、安装
-
### 2、安装
-
```shell
-
```shell
$ hub install painttransformer
$ hub install paint
_
transformer
```
```
-
如您安装时遇到问题,可参考:
[
零基础windows安装
](
../../../../docs/docs_ch/get_start/windows_quickstart.md
)
-
如您安装时遇到问题,可参考:
[
零基础windows安装
](
../../../../docs/docs_ch/get_start/windows_quickstart.md
)
|
[
零基础Linux安装
](
../../../../docs/docs_ch/get_start/linux_quickstart.md
)
|
[
零基础MacOS安装
](
../../../../docs/docs_ch/get_start/mac_quickstart.md
)
|
[
零基础Linux安装
](
../../../../docs/docs_ch/get_start/linux_quickstart.md
)
|
[
零基础MacOS安装
](
../../../../docs/docs_ch/get_start/mac_quickstart.md
)
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
-
```shell
-
```shell
# Read from a file
# Read from a file
$ hub run painttransformer --input_path "/PATH/TO/IMAGE"
$ hub run paint
_
transformer --input_path "/PATH/TO/IMAGE"
```
```
-
通过命令行方式实现风格转换模型的调用,更多请见
[
PaddleHub命令行指令
](
../../../../docs/docs_ch/tutorial/cmd_usage.rst
)
-
通过命令行方式实现风格转换模型的调用,更多请见
[
PaddleHub命令行指令
](
../../../../docs/docs_ch/tutorial/cmd_usage.rst
)
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
-
```python
-
```python
import paddlehub as hub
import paddlehub as hub
module = hub.Module(name="painttransformer")
module = hub.Module(name="paint
_
transformer")
input_path = ["/PATH/TO/IMAGE"]
input_path = ["/PATH/TO/IMAGE"]
# Read from a file
# Read from a file
module.style_transfer(paths=input_path, output_dir='./transfer_result/', use_gpu=True)
module.style_transfer(paths=input_path, output_dir='./transfer_result/', use_gpu=True)
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
-
运行启动命令:
-
运行启动命令:
-
```shell
-
```shell
$ hub serving start -m painttransformer
$ hub serving start -m paint
_
transformer
```
```
-
这样就完成了一个油画风格转换的在线服务API的部署,默认端口号为8866。
-
这样就完成了一个油画风格转换的在线服务API的部署,默认端口号为8866。
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
# 发送HTTP请求
# 发送HTTP请求
data = {'images':[cv2_to_base64(cv2.imread("/PATH/TO/IMAGE"))]}
data = {'images':[cv2_to_base64(cv2.imread("/PATH/TO/IMAGE"))]}
headers = {"Content-type": "application/json"}
headers = {"Content-type": "application/json"}
url = "http://127.0.0.1:8866/predict/painttransformer"
url = "http://127.0.0.1:8866/predict/paint
_
transformer"
r = requests.post(url=url, headers=headers, data=json.dumps(data))
r = requests.post(url=url, headers=headers, data=json.dumps(data))
# 打印预测结果
# 打印预测结果
...
@@ -130,5 +130,5 @@
...
@@ -130,5 +130,5 @@
初始发布
初始发布
- ```
shell
- ```
shell
$ hub install painttransformer==1.0.0
$ hub install paint
_
transformer==1.0.0
```
```
modules/image/Image_gan/style_transfer/painttransformer/brush/brush_large_horizontal.png
→
modules/image/Image_gan/style_transfer/paint
_
transformer/brush/brush_large_horizontal.png
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/brush/brush_large_vertical.png
→
modules/image/Image_gan/style_transfer/paint
_
transformer/brush/brush_large_vertical.png
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/inference.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/inference.py
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/model.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/model.py
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/module.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/module.py
浏览文件 @
c48d8210
...
@@ -31,13 +31,13 @@ from .util import base64_to_cv2
...
@@ -31,13 +31,13 @@ from .util import base64_to_cv2
@
moduleinfo
(
@
moduleinfo
(
name
=
"painttransformer"
,
name
=
"paint
_
transformer"
,
type
=
"CV/style_transfer"
,
type
=
"CV/style_transfer"
,
author
=
"paddlepaddle"
,
author
=
"paddlepaddle"
,
author_email
=
""
,
author_email
=
""
,
summary
=
""
,
summary
=
""
,
version
=
"1.0.0"
)
version
=
"1.0.0"
)
class
painttransformer
:
class
paint
_
transformer
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
pretrained_model
=
os
.
path
.
join
(
self
.
directory
,
"paint_best.pdparams"
)
self
.
pretrained_model
=
os
.
path
.
join
(
self
.
directory
,
"paint_best.pdparams"
)
...
...
modules/image/Image_gan/style_transfer/painttransformer/render_parallel.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/render_parallel.py
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/render_serial.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/render_serial.py
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/render_utils.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/render_utils.py
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/requirements.txt
→
modules/image/Image_gan/style_transfer/paint
_
transformer/requirements.txt
浏览文件 @
c48d8210
文件已移动
modules/image/Image_gan/style_transfer/painttransformer/util.py
→
modules/image/Image_gan/style_transfer/paint
_
transformer/util.py
浏览文件 @
c48d8210
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录