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
701adba2
Unverified
Commit
701adba2
authored
Jul 29, 2020
by
shaohua.zhang
Committed by
GitHub
Jul 29, 2020
Browse files
Merge pull request #7 from PaddlePaddle/develop
update-2020-7-29
parents
036e1136
301aac1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ppocr/utils/utility.py
ppocr/utils/utility.py
+6
-4
No files found.
ppocr/utils/utility.py
View file @
701adba2
...
...
@@ -14,6 +14,7 @@
import
logging
import
os
import
imghdr
def
initial_logger
():
...
...
@@ -61,13 +62,14 @@ def get_image_file_list(img_file):
if
img_file
is
None
or
not
os
.
path
.
exists
(
img_file
):
raise
Exception
(
"not found any img file in {}"
.
format
(
img_file
))
img_end
=
[
'jpg'
,
'png'
,
'jpeg'
,
'
JPEG
'
,
'
JPG
'
,
'
bmp'
]
if
os
.
path
.
isfile
(
img_file
)
and
img
_file
.
split
(
'.'
)[
-
1
]
in
img_end
:
img_end
=
{
'jpg'
,
'bmp'
,
'png'
,
'jpeg'
,
'
rgb
'
,
'
tif
'
,
'
tiff'
}
if
os
.
path
.
isfile
(
img_file
)
and
img
hdr
.
what
(
img_file
)
in
img_end
:
imgs_lists
.
append
(
img_file
)
elif
os
.
path
.
isdir
(
img_file
):
for
single_file
in
os
.
listdir
(
img_file
):
if
single_file
.
split
(
'.'
)[
-
1
]
in
img_end
:
imgs_lists
.
append
(
os
.
path
.
join
(
img_file
,
single_file
))
file_path
=
os
.
path
.
join
(
img_file
,
single_file
)
if
imghdr
.
what
(
file_path
)
in
img_end
:
imgs_lists
.
append
(
file_path
)
if
len
(
imgs_lists
)
==
0
:
raise
Exception
(
"not found any img file in {}"
.
format
(
img_file
))
return
imgs_lists
...
...
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