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
0707f743
Commit
0707f743
authored
May 26, 2021
by
LDOUBLEV
Browse files
delete debug code
parent
c946b386
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
19 deletions
+1
-19
tools/infer/utility.py
tools/infer/utility.py
+1
-19
No files found.
tools/infer/utility.py
View file @
0707f743
...
@@ -497,22 +497,4 @@ def draw_boxes(image, boxes, scores=None, drop_score=0.5):
...
@@ -497,22 +497,4 @@ def draw_boxes(image, boxes, scores=None, drop_score=0.5):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_img
=
"./doc/test_v2"
pass
predict_txt
=
"./doc/predict.txt"
f
=
open
(
predict_txt
,
'r'
)
data
=
f
.
readlines
()
img_path
,
anno
=
data
[
0
].
strip
().
split
(
'
\t
'
)
img_name
=
os
.
path
.
basename
(
img_path
)
img_path
=
os
.
path
.
join
(
test_img
,
img_name
)
image
=
Image
.
open
(
img_path
)
data
=
json
.
loads
(
anno
)
boxes
,
txts
,
scores
=
[],
[],
[]
for
dic
in
data
:
boxes
.
append
(
dic
[
'points'
])
txts
.
append
(
dic
[
'transcription'
])
scores
.
append
(
round
(
dic
[
'scores'
],
3
))
new_img
=
draw_ocr
(
image
,
boxes
,
txts
,
scores
)
cv2
.
imwrite
(
img_name
,
new_img
)
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