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
10ac1722
"tools/git@developer.sourcefind.cn:OpenDAS/torchani.git" did not exist on "54ab56ee289dcd59a4ac6fa5a7b3202d6b642863"
Unverified
Commit
10ac1722
authored
May 25, 2020
by
Double_V
Committed by
GitHub
May 25, 2020
Browse files
Merge pull request #96 from LDOUBLEV/fixocr
Fixocr
parents
c63624b3
93bd46e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+0
-1
tools/infer/utility.py
tools/infer/utility.py
+1
-2
No files found.
tools/infer/predict_rec.py
View file @
10ac1722
...
@@ -117,7 +117,6 @@ if __name__ == "__main__":
...
@@ -117,7 +117,6 @@ if __name__ == "__main__":
valid_image_file_list
.
append
(
image_file
)
valid_image_file_list
.
append
(
image_file
)
img_list
.
append
(
img
)
img_list
.
append
(
img
)
rec_res
,
predict_time
=
text_recognizer
(
img_list
)
rec_res
,
predict_time
=
text_recognizer
(
img_list
)
rec_res
,
predict_time
=
text_recognizer
(
img_list
)
for
ino
in
range
(
len
(
img_list
)):
for
ino
in
range
(
len
(
img_list
)):
print
(
"Predicts of %s:%s"
%
(
valid_image_file_list
[
ino
],
rec_res
[
ino
]))
print
(
"Predicts of %s:%s"
%
(
valid_image_file_list
[
ino
],
rec_res
[
ino
]))
print
(
"Total predict time for %d images:%.3f"
%
print
(
"Total predict time for %d images:%.3f"
%
...
...
tools/infer/utility.py
View file @
10ac1722
...
@@ -174,8 +174,7 @@ def draw_ocr(image, boxes, txts, scores, draw_txt=True, drop_score=0.5):
...
@@ -174,8 +174,7 @@ def draw_ocr(image, boxes, txts, scores, draw_txt=True, drop_score=0.5):
continue
continue
font
=
ImageFont
.
truetype
(
font
=
ImageFont
.
truetype
(
"./doc/simfang.ttf"
,
font_size
,
encoding
=
"utf-8"
)
"./doc/simfang.ttf"
,
font_size
,
encoding
=
"utf-8"
)
new_txt
=
str
(
count
)
+
': '
+
txt
+
' '
+
'%.3f'
%
(
new_txt
=
str
(
idx
)
+
': '
+
txt
+
' '
+
'%.3f'
%
(
scores
[
idx
])
scores
[
count
])
draw_txt
.
text
(
draw_txt
.
text
(
(
20
,
gap
*
(
count
+
1
)),
new_txt
,
txt_color
,
font
=
font
)
(
20
,
gap
*
(
count
+
1
)),
new_txt
,
txt_color
,
font
=
font
)
count
+=
1
count
+=
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