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
c15d3bb0
Commit
c15d3bb0
authored
May 14, 2020
by
LDOUBLEV
Browse files
add visualize code to predict_eval
parent
073b8517
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
31 additions
and
12 deletions
+31
-12
README.md
README.md
+9
-9
doc/imgs/.DS_Store
doc/imgs/.DS_Store
+0
-0
doc/imgs_results/1.jpg
doc/imgs_results/1.jpg
+0
-0
doc/imgs_results/10.jpg
doc/imgs_results/10.jpg
+0
-0
doc/imgs_results/11.jpg
doc/imgs_results/11.jpg
+0
-0
doc/imgs_results/12.jpg
doc/imgs_results/12.jpg
+0
-0
doc/imgs_results/13.png
doc/imgs_results/13.png
+0
-0
doc/imgs_results/15.jpg
doc/imgs_results/15.jpg
+0
-0
doc/imgs_results/16.png
doc/imgs_results/16.png
+0
-0
doc/imgs_results/17.png
doc/imgs_results/17.png
+0
-0
doc/imgs_results/2.jpg
doc/imgs_results/2.jpg
+0
-0
doc/imgs_results/22.jpg
doc/imgs_results/22.jpg
+0
-0
doc/imgs_results/3.jpg
doc/imgs_results/3.jpg
+0
-0
doc/imgs_results/4.jpg
doc/imgs_results/4.jpg
+0
-0
doc/imgs_results/5.jpg
doc/imgs_results/5.jpg
+0
-0
doc/imgs_results/6.jpg
doc/imgs_results/6.jpg
+0
-0
doc/imgs_results/7.jpg
doc/imgs_results/7.jpg
+0
-0
doc/imgs_results/8.jpg
doc/imgs_results/8.jpg
+0
-0
doc/imgs_results/9.jpg
doc/imgs_results/9.jpg
+0
-0
tools/infer/predict_system.py
tools/infer/predict_system.py
+22
-3
No files found.
README.md
View file @
c15d3bb0
...
...
@@ -11,7 +11,7 @@ PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力
## **超轻量级中文OCR体验**


上图是超轻量级中文OCR模型效果展示,更多效果图请见文末
[
效果展示
](
#效果展示
)
。
...
...
@@ -97,14 +97,14 @@ PaddleOCR文本识别算法的训练和使用请参考文档教程中[文本识
<a
name=
"效果展示"
></a>
## 效果展示
















## 参考文献
...
...
doc/imgs/.DS_Store
deleted
100644 → 0
View file @
073b8517
File deleted
doc/imgs_
draw
/1.jpg
→
doc/imgs_
results
/1.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/10.jpg
→
doc/imgs_
results
/10.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/11.jpg
→
doc/imgs_
results
/11.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/12.jpg
→
doc/imgs_
results
/12.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/13.png
→
doc/imgs_
results
/13.png
View file @
c15d3bb0
File moved
doc/imgs_
draw
/15.jpg
→
doc/imgs_
results
/15.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/16.png
→
doc/imgs_
results
/16.png
View file @
c15d3bb0
File moved
doc/imgs_
draw
/17.png
→
doc/imgs_
results
/17.png
View file @
c15d3bb0
File moved
doc/imgs_
draw
/2.jpg
→
doc/imgs_
results
/2.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/22.jpg
→
doc/imgs_
results
/22.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/3.jpg
→
doc/imgs_
results
/3.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/4.jpg
→
doc/imgs_
results
/4.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/5.jpg
→
doc/imgs_
results
/5.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/6.jpg
→
doc/imgs_
results
/6.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/7.jpg
→
doc/imgs_
results
/7.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/8.jpg
→
doc/imgs_
results
/8.jpg
View file @
c15d3bb0
File moved
doc/imgs_
draw
/9.jpg
→
doc/imgs_
results
/9.jpg
View file @
c15d3bb0
File moved
tools/infer/predict_system.py
View file @
c15d3bb0
...
...
@@ -22,6 +22,10 @@ import copy
import
numpy
as
np
import
math
import
time
from
ppocr.utils.utility
import
get_image_file_list
from
PIL
import
Image
from
tools.infer.utility
import
draw_ocr
import
os
class
TextSystem
(
object
):
...
...
@@ -99,8 +103,9 @@ def sorted_boxes(dt_boxes):
if
__name__
==
"__main__"
:
args
=
utility
.
parse_args
()
image_file_list
=
utility
.
get_image_file_list
(
args
.
image_dir
)
image_file_list
=
get_image_file_list
(
args
.
image_dir
)
text_sys
=
TextSystem
(
args
)
is_visualize
=
True
for
image_file
in
image_file_list
:
img
=
cv2
.
imread
(
image_file
)
if
img
is
None
:
...
...
@@ -114,8 +119,22 @@ if __name__ == "__main__":
dt_boxes_final
=
[]
for
dno
in
range
(
dt_num
):
text
,
score
=
rec_res
[
dno
]
if
score
>=
0
:
if
score
>=
0
.5
:
text_str
=
"%s, %.3f"
%
(
text
,
score
)
print
(
text_str
)
dt_boxes_final
.
append
(
dt_boxes
[
dno
])
utility
.
draw_text_det_res
(
dt_boxes_final
,
image_file
)
if
is_visualize
:
image
=
Image
.
fromarray
(
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2RGB
))
boxes
=
dt_boxes
txts
=
[
rec_res
[
i
][
0
]
for
i
in
range
(
len
(
rec_res
))]
scores
=
[
rec_res
[
i
][
1
]
for
i
in
range
(
len
(
rec_res
))]
draw_img
=
draw_ocr
(
image
,
boxes
,
txts
,
scores
,
draw_txt
=
True
,
drop_score
=
0.5
)
draw_img_save
=
"./doc/imgs_results/"
if
not
os
.
path
.
exists
(
draw_img_save
):
os
.
makedirs
(
draw_img_save
)
cv2
.
imwrite
(
os
.
path
.
join
(
draw_img_save
,
os
.
path
.
basename
(
image_file
)),
draw_img
)
Prev
1
2
Next
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