Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
067ba31f
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看板
提交
067ba31f
编写于
8月 31, 2020
作者:
S
syyxsxx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mkldnn
上级
654adfe9
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
18 addition
and
17 deletion
+18
-17
deploy/cpp/demo/classifier.cpp
deploy/cpp/demo/classifier.cpp
+2
-2
deploy/cpp/demo/detector.cpp
deploy/cpp/demo/detector.cpp
+2
-2
deploy/cpp/demo/segmenter.cpp
deploy/cpp/demo/segmenter.cpp
+2
-2
deploy/cpp/demo/video_classifier.cpp
deploy/cpp/demo/video_classifier.cpp
+2
-2
deploy/cpp/demo/video_detector.cpp
deploy/cpp/demo/video_detector.cpp
+2
-2
deploy/cpp/demo/video_segmenter.cpp
deploy/cpp/demo/video_segmenter.cpp
+2
-2
deploy/cpp/include/paddlex/paddlex.h
deploy/cpp/include/paddlex/paddlex.h
+5
-4
deploy/cpp/src/paddlex.cpp
deploy/cpp/src/paddlex.cpp
+1
-1
未找到文件。
deploy/cpp/demo/classifier.cpp
浏览文件 @
067ba31f
...
...
@@ -61,9 +61,9 @@ int main(int argc, char** argv) {
FLAGS_use_gpu
,
FLAGS_use_trt
,
FLAGS_use_mkl
,
FLAGS_mkl_thread_num
,
FLAGS_gpu_id
,
FLAGS_key
,
FLAGS_mkl_thread_num
);
FLAGS_key
);
// Predict
int
imgs
=
1
;
...
...
deploy/cpp/demo/detector.cpp
浏览文件 @
067ba31f
...
...
@@ -66,9 +66,9 @@ int main(int argc, char** argv) {
FLAGS_use_gpu
,
FLAGS_use_trt
,
FLAGS_use_mkl
,
FLAGS_mkl_thread_num
,
FLAGS_gpu_id
,
FLAGS_key
,
FLAGS_mkl_thread_num
);
FLAGS_key
);
int
imgs
=
1
;
std
::
string
save_dir
=
"output"
;
// Predict
...
...
deploy/cpp/demo/segmenter.cpp
浏览文件 @
067ba31f
...
...
@@ -63,9 +63,9 @@ int main(int argc, char** argv) {
FLAGS_use_gpu
,
FLAGS_use_trt
,
FLAGS_use_mkl
,
FLAGS_mkl_thread_num
,
FLAGS_gpu_id
,
FLAGS_key
,
FLAGS_mkl_thread_num
);
FLAGS_key
);
int
imgs
=
1
;
// Predict
if
(
FLAGS_image_list
!=
""
)
{
...
...
deploy/cpp/demo/video_classifier.cpp
浏览文件 @
067ba31f
...
...
@@ -67,9 +67,9 @@ int main(int argc, char** argv) {
FLAGS_use_gpu
,
FLAGS_use_trt
,
FLAGS_use_mkl
,
FLAGS_mkl_thread_num
,
FLAGS_gpu_id
,
FLAGS_key
,
FLAGS_mkl_thread_num
);
FLAGS_key
);
// Open video
cv
::
VideoCapture
capture
;
...
...
deploy/cpp/demo/video_detector.cpp
浏览文件 @
067ba31f
...
...
@@ -69,9 +69,9 @@ int main(int argc, char** argv) {
FLAGS_use_gpu
,
FLAGS_use_trt
,
FLAGS_use_mkl
,
FLAGS_mkl_thread_num
,
FLAGS_gpu_id
,
FLAGS_key
,
FLAGS_mkl_thread_num
);
FLAGS_key
);
// Open video
cv
::
VideoCapture
capture
;
if
(
FLAGS_use_camera
)
{
...
...
deploy/cpp/demo/video_segmenter.cpp
浏览文件 @
067ba31f
...
...
@@ -67,9 +67,9 @@ int main(int argc, char** argv) {
FLAGS_use_gpu
,
FLAGS_use_trt
,
FLAGS_use_mkl
,
FLAGS_mkl_thread_num
,
FLAGS_gpu_id
,
FLAGS_key
,
FLAGS_mkl_thread_num
);
FLAGS_key
);
// Open video
cv
::
VideoCapture
capture
;
if
(
FLAGS_use_camera
)
{
...
...
deploy/cpp/include/paddlex/paddlex.h
浏览文件 @
067ba31f
...
...
@@ -70,6 +70,8 @@ class Model {
* @param model_dir: the directory which contains model.yml
* @param use_gpu: use gpu or not when infering
* @param use_trt: use Tensor RT or not when infering
* @param use_trt: use mkl or not when infering
* @param mkl_thread_num: the threads of mkl when infering
* @param gpu_id: the id of gpu when infering with using gpu
* @param key: the key of encryption when using encrypted model
* @param use_ir_optim: use ir optimization when infering
...
...
@@ -78,28 +80,27 @@ class Model {
bool
use_gpu
=
false
,
bool
use_trt
=
false
,
bool
use_mkl
=
true
,
int
mkl_thread_num
=
4
,
int
gpu_id
=
0
,
std
::
string
key
=
""
,
int
mkl_thread_num
=
4
,
bool
use_ir_optim
=
true
)
{
create_predictor
(
model_dir
,
use_gpu
,
use_trt
,
use_mkl
,
mkl_thread_num
,
gpu_id
,
key
,
mkl_thread_num
,
use_ir_optim
);
}
void
create_predictor
(
const
std
::
string
&
model_dir
,
bool
use_gpu
=
false
,
bool
use_trt
=
false
,
bool
use_mkl
=
true
,
int
mkl_thread_num
=
4
,
int
gpu_id
=
0
,
std
::
string
key
=
""
,
int
mkl_thread_num
=
4
,
bool
use_ir_optim
=
true
);
/*
...
...
deploy/cpp/src/paddlex.cpp
浏览文件 @
067ba31f
...
...
@@ -29,9 +29,9 @@ void Model::create_predictor(const std::string& model_dir,
bool
use_gpu
,
bool
use_trt
,
bool
use_mkl
,
int
mkl_thread_num
,
int
gpu_id
,
std
::
string
key
,
int
mkl_thread_num
,
bool
use_ir_optim
)
{
paddle
::
AnalysisConfig
config
;
std
::
string
model_file
=
model_dir
+
OS_PATH_SEP
+
"__model__"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录