Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
6a33155d
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看板
提交
6a33155d
编写于
8月 30, 2019
作者:
C
chenguowei01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update check.py
上级
8b1504aa
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
11 deletion
+16
-11
pdseg/check.py
pdseg/check.py
+16
-11
未找到文件。
pdseg/check.py
浏览文件 @
6a33155d
...
@@ -200,7 +200,7 @@ def gt_check():
...
@@ -200,7 +200,7 @@ def gt_check():
total_nc
=
sorted
(
zip
(
total_grt_classes
,
total_num_of_each_class
))
total_nc
=
sorted
(
zip
(
total_grt_classes
,
total_num_of_each_class
))
logger
.
info
(
"
\n
Doing label pixel statistics...
\n
Total label c
al
sses "
logger
.
info
(
"
\n
Doing label pixel statistics...
\n
Total label c
la
sses "
"and their corresponding numbers:
\n
{} "
.
format
(
total_nc
))
"and their corresponding numbers:
\n
{} "
.
format
(
total_nc
))
if
len
(
label_wrong
)
==
0
and
not
total_nc
[
0
][
0
]:
if
len
(
label_wrong
)
==
0
and
not
total_nc
[
0
][
0
]:
...
@@ -340,7 +340,8 @@ def label_gray_check():
...
@@ -340,7 +340,8 @@ def label_gray_check():
logger
.
info
(
"All label images are gray"
)
logger
.
info
(
"All label images are gray"
)
else
:
else
:
logger
.
info
(
error_print
(
"label gray check"
))
logger
.
info
(
error_print
(
"label gray check"
))
logger
.
info
(
"{} label images are not gray"
.
format
(
len
(
label_gray_wrong
)))
logger
.
info
(
"{} label images are not gray
\n
Label pixel statistics may "
"be insignificant"
.
format
(
len
(
label_gray_wrong
)))
for
i
in
label_gray_wrong
:
for
i
in
label_gray_wrong
:
logger
.
debug
(
i
)
logger
.
debug
(
i
)
...
@@ -367,8 +368,8 @@ def check_train_dataset():
...
@@ -367,8 +368,8 @@ def check_train_dataset():
imread_failed
.
append
((
line
,
str
(
e
)))
imread_failed
.
append
((
line
,
str
(
e
)))
continue
continue
is_
label_gray
=
label_gray_check
(
grt
)
is_
gray
=
is_label_gray
(
grt
)
if
not
is_
label_
gray
:
if
not
is_gray
:
label_gray_wrong
.
append
(
line
)
label_gray_wrong
.
append
(
line
)
grt
=
cv2
.
cvtColor
(
grt
,
cv2
.
COLOR_BGR2GRAY
)
grt
=
cv2
.
cvtColor
(
grt
,
cv2
.
COLOR_BGR2GRAY
)
get_image_dim
(
img
)
get_image_dim
(
img
)
...
@@ -385,6 +386,7 @@ def check_train_dataset():
...
@@ -385,6 +386,7 @@ def check_train_dataset():
file_list_check
(
list_file
)
file_list_check
(
list_file
)
imread_check
()
imread_check
()
label_gray_check
()
gt_check
()
gt_check
()
image_type_check
(
img_dim
)
image_type_check
(
img_dim
)
shape_check
()
shape_check
()
...
@@ -413,8 +415,8 @@ def check_val_dataset():
...
@@ -413,8 +415,8 @@ def check_val_dataset():
except
Exception
as
e
:
except
Exception
as
e
:
imread_failed
.
append
((
line
,
e
.
message
))
imread_failed
.
append
((
line
,
e
.
message
))
is_
label_gray
=
label_gray_check
(
grt
)
is_
gray
=
is_label_gray
(
grt
)
if
not
is_
label_
gray
:
if
not
is_gray
:
label_gray_wrong
.
append
(
line
)
label_gray_wrong
.
append
(
line
)
grt
=
cv2
.
cvtColor
(
grt
,
cv2
.
COLOR_BGR2GRAY
)
grt
=
cv2
.
cvtColor
(
grt
,
cv2
.
COLOR_BGR2GRAY
)
get_image_max_height_width
(
img
)
get_image_max_height_width
(
img
)
...
@@ -432,6 +434,7 @@ def check_val_dataset():
...
@@ -432,6 +434,7 @@ def check_val_dataset():
file_list_check
(
list_file
)
file_list_check
(
list_file
)
imread_check
()
imread_check
()
label_gray_check
()
gt_check
()
gt_check
()
image_type_check
(
img_dim
)
image_type_check
(
img_dim
)
shape_check
()
shape_check
()
...
@@ -466,8 +469,8 @@ def check_test_dataset():
...
@@ -466,8 +469,8 @@ def check_test_dataset():
imread_failed
.
append
((
line
,
e
.
message
))
imread_failed
.
append
((
line
,
e
.
message
))
continue
continue
is_
label_gray
=
label_gray_check
(
grt
)
is_
gray
=
is_label_gray
(
grt
)
if
not
is_
label_
gray
:
if
not
is_gray
:
label_gray_wrong
.
append
(
line
)
label_gray_wrong
.
append
(
line
)
grt
=
cv2
.
cvtColor
(
grt
,
cv2
.
COLOR_BGR2GRAY
)
grt
=
cv2
.
cvtColor
(
grt
,
cv2
.
COLOR_BGR2GRAY
)
is_equal_img_grt_shape
=
image_label_shape_check
(
img
,
grt
)
is_equal_img_grt_shape
=
image_label_shape_check
(
img
,
grt
)
...
@@ -488,6 +491,8 @@ def check_test_dataset():
...
@@ -488,6 +491,8 @@ def check_test_dataset():
file_list_check
(
list_file
)
file_list_check
(
list_file
)
imread_check
()
imread_check
()
if
has_label
:
label_gray_check
()
if
has_label
:
if
has_label
:
gt_check
()
gt_check
()
image_type_check
(
img_dim
)
image_type_check
(
img_dim
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录