Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
e7ede460
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
285
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e7ede460
编写于
3月 30, 2020
作者:
S
sjtubinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
上级
ad9da388
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
11 addition
and
4 deletion
+11
-4
contrib/RealTimeHumanSeg/cpp/CMakeLists.txt
contrib/RealTimeHumanSeg/cpp/CMakeLists.txt
+0
-0
contrib/RealTimeHumanSeg/cpp/CMakeSettings.json
contrib/RealTimeHumanSeg/cpp/CMakeSettings.json
+0
-0
contrib/RealTimeHumanSeg/cpp/README.md
contrib/RealTimeHumanSeg/cpp/README.md
+0
-0
contrib/RealTimeHumanSeg/cpp/docs/linux_build.md
contrib/RealTimeHumanSeg/cpp/docs/linux_build.md
+0
-0
contrib/RealTimeHumanSeg/cpp/docs/windows_build.md
contrib/RealTimeHumanSeg/cpp/docs/windows_build.md
+0
-0
contrib/RealTimeHumanSeg/cpp/humanseg.cc
contrib/RealTimeHumanSeg/cpp/humanseg.cc
+5
-2
contrib/RealTimeHumanSeg/cpp/humanseg.h
contrib/RealTimeHumanSeg/cpp/humanseg.h
+4
-1
contrib/RealTimeHumanSeg/cpp/humanseg_postprocess.cc
contrib/RealTimeHumanSeg/cpp/humanseg_postprocess.cc
+0
-0
contrib/RealTimeHumanSeg/cpp/humanseg_postprocess.h
contrib/RealTimeHumanSeg/cpp/humanseg_postprocess.h
+0
-0
contrib/RealTimeHumanSeg/cpp/linux_build.sh
contrib/RealTimeHumanSeg/cpp/linux_build.sh
+0
-0
contrib/RealTimeHumanSeg/cpp/main.cc
contrib/RealTimeHumanSeg/cpp/main.cc
+2
-1
未找到文件。
contrib/RealTimeHumanSeg/CMakeLists.txt
→
contrib/RealTimeHumanSeg/
cpp/
CMakeLists.txt
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/CMakeSettings.json
→
contrib/RealTimeHumanSeg/
cpp/
CMakeSettings.json
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/README.md
→
contrib/RealTimeHumanSeg/
cpp/
README.md
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/docs/linux_build.md
→
contrib/RealTimeHumanSeg/
cpp/
docs/linux_build.md
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/docs/windows_build.md
→
contrib/RealTimeHumanSeg/
cpp/
docs/windows_build.md
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/humanseg.cc
→
contrib/RealTimeHumanSeg/
cpp/
humanseg.cc
浏览文件 @
e7ede460
...
...
@@ -44,7 +44,9 @@ void LoadModel(
std
::
unique_ptr
<
paddle
::
PaddlePredictor
>*
predictor
)
{
// Config the model info
paddle
::
AnalysisConfig
config
;
config
.
SetModel
(
model_dir
);
auto
prog_file
=
model_dir
+
"/__model__"
;
auto
params_file
=
model_dir
+
"/__params__"
;
config
.
SetModel
(
prog_file
,
params_file
);
if
(
use_gpu
)
{
config
.
EnableUseGpu
(
100
,
0
);
}
else
{
...
...
@@ -60,7 +62,8 @@ void LoadModel(
void
HumanSeg
::
Preprocess
(
const
cv
::
Mat
&
image_mat
)
{
// Clone the image : keep the original mat for postprocess
cv
::
Mat
im
=
image_mat
.
clone
();
cv
::
resize
(
im
,
im
,
cv
::
Size
(
192
,
192
),
0.
f
,
0.
f
,
cv
::
INTER_LINEAR
);
auto
eval_wh
=
cv
::
Size
(
eval_size_
[
0
],
eval_size_
[
1
]);
cv
::
resize
(
im
,
im
,
eval_wh
,
0.
f
,
0.
f
,
cv
::
INTER_LINEAR
);
im
.
convertTo
(
im
,
CV_32FC3
,
1.0
);
int
rc
=
im
.
channels
();
...
...
contrib/RealTimeHumanSeg/humanseg.h
→
contrib/RealTimeHumanSeg/
cpp/
humanseg.h
浏览文件 @
e7ede460
...
...
@@ -37,9 +37,11 @@ class HumanSeg {
explicit
HumanSeg
(
const
std
::
string
&
model_dir
,
const
std
::
vector
<
float
>&
mean
,
const
std
::
vector
<
float
>&
scale
,
const
std
::
vector
<
int
>&
eval_size
,
bool
use_gpu
=
false
)
:
mean_
(
mean
),
scale_
(
scale
)
{
scale_
(
scale
),
eval_size_
(
eval_size
)
{
LoadModel
(
model_dir
,
use_gpu
,
&
predictor_
);
}
...
...
@@ -60,4 +62,5 @@ class HumanSeg {
std
::
vector
<
uchar
>
segout_data_
;
std
::
vector
<
float
>
mean_
;
std
::
vector
<
float
>
scale_
;
std
::
vector
<
int
>
eval_size_
;
};
contrib/RealTimeHumanSeg/humanseg_postprocess.cc
→
contrib/RealTimeHumanSeg/
cpp/
humanseg_postprocess.cc
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/humanseg_postprocess.h
→
contrib/RealTimeHumanSeg/
cpp/
humanseg_postprocess.h
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/linux_build.sh
→
contrib/RealTimeHumanSeg/
cpp/
linux_build.sh
浏览文件 @
e7ede460
文件已移动
contrib/RealTimeHumanSeg/main.cc
→
contrib/RealTimeHumanSeg/
cpp/
main.cc
浏览文件 @
e7ede460
...
...
@@ -78,7 +78,8 @@ int main(int argc, char* argv[]) {
// Init Model
std
::
vector
<
float
>
means
=
{
104.008
,
116.669
,
122.675
};
std
::
vector
<
float
>
scale
=
{
1.000
,
1.000
,
1.000
};
HumanSeg
seg
(
model_dir
,
means
,
scale
,
use_gpu
);
std
::
vector
<
int
>
eval_sz
=
{
192
,
192
};
HumanSeg
seg
(
model_dir
,
means
,
scale
,
eval_sz
,
use_gpu
);
// Call ImagePredict while input_path is a image file path
// The output will be saved as result.jpeg
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录