Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
881fc5df
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
136
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
881fc5df
编写于
7月 17, 2020
作者:
C
chenguowei01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
45e5dc07
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
5 deletion
+5
-5
paddlex/cv/datasets/dataset.py
paddlex/cv/datasets/dataset.py
+1
-2
paddlex/cv/models/deeplabv3p.py
paddlex/cv/models/deeplabv3p.py
+2
-1
paddlex/cv/transforms/seg_transforms.py
paddlex/cv/transforms/seg_transforms.py
+2
-2
未找到文件。
paddlex/cv/datasets/dataset.py
浏览文件 @
881fc5df
...
...
@@ -228,8 +228,7 @@ def generate_minibatch(batch_data, label_padding_value=255):
elif
len
(
data
)
>
1
:
if
isinstance
(
data
[
1
],
np
.
ndarray
)
and
len
(
data
[
1
].
shape
)
>
1
:
# padding the image and label of segmentation
# during the training and evaluating phase
# padding the image and label of segmentation during the training
# the data[1] of segmentation is a image array,
# so len(data[1].shape) > 1
padding_label
=
np
.
zeros
(
...
...
paddlex/cv/models/deeplabv3p.py
浏览文件 @
881fc5df
...
...
@@ -360,7 +360,7 @@ class DeepLabv3p(BaseAPI):
pred
=
pred
[
0
:
num_samples
]
for
i
in
range
(
num_samples
):
one_pred
=
pred
[
i
].
astype
(
'
int64
'
)
one_pred
=
pred
[
i
].
astype
(
'
uint8
'
)
one_label
=
labels
[
i
]
for
info
in
im_info
[
i
][::
-
1
]:
if
info
[
0
]
==
'resize'
:
...
...
@@ -372,6 +372,7 @@ class DeepLabv3p(BaseAPI):
else
:
raise
Exception
(
"Unexpected info '{}' in im_info"
.
format
(
info
[
0
]))
one_pred
=
one_pred
.
astype
(
'int64'
)
one_pred
=
one_pred
[
np
.
newaxis
,
:,
:,
np
.
newaxis
]
one_label
=
one_label
[
np
.
newaxis
,
np
.
newaxis
,
:,
:]
mask
=
one_label
!=
self
.
ignore_index
...
...
paddlex/cv/transforms/seg_transforms.py
浏览文件 @
881fc5df
...
...
@@ -90,7 +90,7 @@ class Compose(SegTransform):
if
label
is
not
None
:
if
not
isinstance
(
label
,
np
.
ndarray
):
label
=
np
.
asarray
(
Image
.
open
(
label
))
origin_label
=
label
.
copy
()
origin_label
=
label
.
copy
()
for
op
in
self
.
transforms
:
if
isinstance
(
op
,
SegTransform
):
outputs
=
op
(
im
,
im_info
,
label
)
...
...
@@ -105,7 +105,7 @@ class Compose(SegTransform):
outputs
=
(
im
,
im_info
,
label
)
else
:
outputs
=
(
im
,
im_info
)
if
type
(
self
.
transforms
[
-
1
])
.
__name__
==
'ArrangeSegmenter'
:
if
self
.
transforms
[
-
1
].
__class__
.
__name__
==
'ArrangeSegmenter'
:
if
self
.
transforms
[
-
1
].
mode
==
'eval'
:
if
label
is
not
None
:
outputs
=
(
im
,
im_info
,
origin_label
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录