Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
cfc166c9
Commit
cfc166c9
authored
Jun 19, 2020
by
LDOUBLEV
Browse files
add error message when img is None
parent
af6f9a4b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
ppocr/data/det/dataset_traversal.py
ppocr/data/det/dataset_traversal.py
+3
-0
ppocr/data/det/db_process.py
ppocr/data/det/db_process.py
+2
-0
No files found.
ppocr/data/det/dataset_traversal.py
View file @
cfc166c9
...
...
@@ -94,6 +94,9 @@ class EvalTestReader(object):
batch_outs
=
[]
for
img_path
in
img_list
:
img
=
cv2
.
imread
(
img_path
)
if
img
is
None
:
logger
.
info
(
"{} does not exist!"
.
format
(
img_path
))
continue
if
len
(
list
(
img
.
shape
))
==
2
or
img
.
shape
[
2
]
==
1
:
img
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_GRAY2BGR
)
if
img
is
None
:
...
...
ppocr/data/det/db_process.py
View file @
cfc166c9
...
...
@@ -104,6 +104,8 @@ class DBProcessTrain(object):
if
imgvalue
is
None
:
logger
.
info
(
"{} does not exist!"
.
format
(
img_path
))
return
None
if
len
(
list
(
imgvalue
.
shape
))
==
2
or
imgvalue
.
shape
[
2
]
==
1
:
imgvalue
=
cv2
.
cvtColor
(
imgvalue
,
cv2
.
COLOR_GRAY2BGR
)
data
=
self
.
make_data_dict
(
imgvalue
,
gt_label
)
data
=
AugmentData
(
data
)
data
=
RandomCropData
(
data
,
self
.
image_shape
[
1
:])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment