Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
970befc1
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看板
提交
970befc1
编写于
10月 23, 2019
作者:
J
joey12300
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge the visualize.py
上级
882e145a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
12 addition
and
23 deletion
+12
-23
inference/tools/visualize.py
inference/tools/visualize.py
+4
-5
serving/seg-serving/op/reader_op.cpp
serving/seg-serving/op/reader_op.cpp
+8
-18
未找到文件。
inference/tools/visualize.py
浏览文件 @
970befc1
...
@@ -9,12 +9,11 @@ color_map = [[128, 64, 128], [244, 35, 231], [69, 69, 69], [102, 102, 156],
...
@@ -9,12 +9,11 @@ color_map = [[128, 64, 128], [244, 35, 231], [69, 69, 69], [102, 102, 156],
[
0
,
0
,
230
],
[
119
,
10
,
32
]]
[
0
,
0
,
230
],
[
119
,
10
,
32
]]
im
=
cv2
.
imread
(
sys
.
argv
[
1
])
im
=
cv2
.
imread
(
sys
.
argv
[
1
])
shape
=
im
.
shape
# Please note (224, 224) just for daheng model
print
(
"visualizing..."
)
print
(
"visualizing..."
)
for
i
in
range
(
0
,
224
):
for
i
in
range
(
0
,
shape
[
0
]
):
for
j
in
range
(
0
,
224
):
for
j
in
range
(
0
,
shape
[
1
]
):
im
[
i
,
j
]
=
color_map
[
im
[
i
,
j
,
0
]]
im
[
i
,
j
]
=
color_map
[
im
[
i
,
j
,
0
]]
cv2
.
imwrite
(
sys
.
argv
[
1
],
im
)
cv2
.
imwrite
(
sys
.
argv
[
2
],
im
)
print
(
"visualizing done!"
)
print
(
"visualizing done!"
)
serving/seg-serving/op/reader_op.cpp
浏览文件 @
970befc1
...
@@ -123,25 +123,15 @@ int ReaderOp::inference() {
...
@@ -123,25 +123,15 @@ int ReaderOp::inference() {
const
int
HH
=
_image_8u_tmp
.
rows
;
const
int
HH
=
_image_8u_tmp
.
rows
;
const
int
WW
=
_image_8u_tmp
.
cols
;
const
int
WW
=
_image_8u_tmp
.
cols
;
const
int
CC
=
_image_8u_tmp
.
channels
();
const
int
CC
=
_image_8u_tmp
.
channels
();
//HH: cols WW:rows
//HH: cols WW:rows
in_width_vec
->
push_back
(
HH
);
in_width_vec
->
push_back
(
HH
);
in_height_vec
->
push_back
(
WW
);
in_height_vec
->
push_back
(
WW
);
// resize
/crop
// resize
if
(
_image_8u_tmp
.
cols
!=
resize
.
width
||
if
(
_image_8u_tmp
.
cols
!=
resize
.
width
||
_image_8u_tmp
.
rows
!=
resize
.
height
)
{
_image_8u_tmp
.
rows
!=
resize
.
height
)
{
// int short_egde = std::min<int>(_image_8u_tmp.cols, _image_8u_tmp.rows);
// int yy = static_cast<int>((_image_8u_tmp.rows - short_egde) / 2);
// int xx = static_cast<int>((_image_8u_tmp.cols - short_egde) / 2);
// _image_8u_tmp =
// cv::Mat(_image_8u_tmp, cv::Rect(xx, yy, short_egde, short_egde));
// if (_image_8u_tmp.cols != resize.width ||
// _image_8u_tmp.rows != resize.height) {
cv
::
Mat
resize_image
;
cv
::
Mat
resize_image
;
// cv::resize(_image_8u_tmp, resize_image, resize);
// _image_8u_tmp = resize_image;
// }
//
cv
::
resize
(
_image_8u_tmp
,
resize_image
,
resize
);
cv
::
resize
(
_image_8u_tmp
,
resize_image
,
resize
);
_image_8u_tmp
=
resize_image
;
_image_8u_tmp
=
resize_image
;
LOG
(
INFO
)
<<
"Succ crop one image[CHW="
<<
_image_8u_tmp
.
channels
()
LOG
(
INFO
)
<<
"Succ crop one image[CHW="
<<
_image_8u_tmp
.
channels
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录