Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
152d0e81
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
138
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
43
列表
看板
标记
里程碑
合并请求
5
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
43
Issue
43
列表
看板
标记
里程碑
合并请求
5
合并请求
5
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
152d0e81
编写于
8月 27, 2020
作者:
S
syyxsxx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm some file
上级
9d8212aa
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
9499 deletion
+0
-9499
deploy/openvino/typescript
deploy/openvino/typescript
+0
-4710
deploy/raspberry/python/convertor.py
deploy/raspberry/python/convertor.py
+0
-79
deploy/raspberry/python/deploy.pyc
deploy/raspberry/python/deploy.pyc
+0
-0
deploy/raspberry/python/utils/__init__.pyc
deploy/raspberry/python/utils/__init__.pyc
+0
-0
deploy/raspberry/python/utils/logging.pyc
deploy/raspberry/python/utils/logging.pyc
+0
-0
deploy/raspberry/typescript
deploy/raspberry/typescript
+0
-4710
未找到文件。
deploy/openvino/typescript
已删除
100644 → 0
浏览文件 @
9d8212aa
此差异已折叠。
点击以展开。
deploy/raspberry/python/convertor.py
已删除
100644 → 0
浏览文件 @
9d8212aa
import
os
from
six
import
text_type
as
_text_type
import
argparse
import
sys
from
utils
import
logging
import
paddlex
as
pdx
def
arg_parser
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--model_dir"
,
"-m"
,
type
=
_text_type
,
default
=
None
,
help
=
"define model directory path"
)
parser
.
add_argument
(
"--save_dir"
,
"-s"
,
type
=
_text_type
,
default
=
None
,
help
=
"path to save inference model"
)
parser
.
add_argument
(
"--fixed_input_shape"
,
"-fs"
,
default
=
None
,
help
=
"export openvino model with input shape:[h,w]"
)
return
parser
def
export_openvino_model
(
model
,
args
):
if
model
.
model_type
==
"detector"
or
model
.
__class__
.
__name__
==
"FastSCNN"
:
logging
.
error
(
"Only image classifier models and semantic segmentation models(except FastSCNN) are supported to export to openvino"
)
try
:
import
x2paddle
if
x2paddle
.
__version__
<
'0.7.4'
:
logging
.
error
(
"You need to upgrade x2paddle >= 0.7.4"
)
except
:
logging
.
error
(
"You need to install x2paddle first, pip install x2paddle>=0.7.4"
)
from
x2paddle.op_mapper.paddle_op_mapper
import
PaddleOpMapper
mapper
=
PaddleOpMapper
()
mapper
.
convert
(
model
.
test_prog
,
args
.
save_dir
)
import
mo.main
as
mo
from
mo.utils.cli_parser
import
get_onnx_cli_parser
onnx_parser
=
get_onnx_cli_parser
()
onnx_parser
.
add_argument
(
"--model_dir"
,
type
=
_text_type
)
onnx_parser
.
add_argument
(
"--save_dir"
,
type
=
_text_type
)
onnx_parser
.
add_argument
(
"--fixed_input_shape"
)
onnx_input
=
os
.
path
.
join
(
args
.
save_dir
,
'x2paddle_model.onnx'
)
onnx_parser
.
set_defaults
(
input_model
=
onnx_input
)
onnx_parser
.
set_defaults
(
output_dir
=
args
.
save_dir
)
shape
=
'[1,3,'
shape
=
shape
+
args
.
fixed_input_shape
[
1
:]
onnx_parser
.
set_defaults
(
input_shape
=
shape
)
mo
.
main
(
onnx_parser
,
'onnx'
)
def
main
():
parser
=
arg_parser
()
args
=
parser
.
parse_args
()
assert
args
.
model_dir
is
not
None
,
"--model_dir should be defined while exporting openvino model"
assert
args
.
save_dir
is
not
None
,
"--save_dir should be defined to create openvino model"
model
=
pdx
.
load_model
(
args
.
model_dir
)
if
model
.
status
==
"Normal"
or
model
.
status
==
"Prune"
:
logging
.
error
(
"Only support inference model, try to export model first as below,"
,
exit
=
False
)
export_openvino_model
(
model
,
args
)
if
__name__
==
"__main__"
:
main
()
deploy/raspberry/python/deploy.pyc
已删除
100644 → 0
浏览文件 @
9d8212aa
文件已删除
deploy/raspberry/python/utils/__init__.pyc
已删除
100644 → 0
浏览文件 @
9d8212aa
文件已删除
deploy/raspberry/python/utils/logging.pyc
已删除
100644 → 0
浏览文件 @
9d8212aa
文件已删除
deploy/raspberry/typescript
已删除
100755 → 0
浏览文件 @
9d8212aa
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录