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
6f456775
Commit
6f456775
authored
Jul 01, 2020
by
LDOUBLEV
Browse files
fix bug
parent
ed454d14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+1
-1
tools/infer_rec.py
tools/infer_rec.py
+1
-1
No files found.
tools/infer/predict_rec.py
View file @
6f456775
...
...
@@ -122,7 +122,7 @@ class TextRecognizer(object):
blank
=
probs
.
shape
[
1
]
valid_ind
=
np
.
where
(
ind
!=
(
blank
-
1
))[
0
]
score
=
np
.
mean
(
probs
[
valid_ind
,
ind
[
valid_ind
]])
if
not
valid_ind
:
if
len
(
valid_ind
)
==
0
:
continue
# rec_res.append([preds_text, score])
rec_res
[
indices
[
beg_img_no
+
rno
]]
=
[
preds_text
,
score
]
...
...
tools/infer_rec.py
View file @
6f456775
...
...
@@ -99,7 +99,7 @@ def main():
ind
=
np
.
argmax
(
probs
,
axis
=
1
)
blank
=
probs
.
shape
[
1
]
valid_ind
=
np
.
where
(
ind
!=
(
blank
-
1
))[
0
]
if
not
valid_ind
:
if
len
(
valid_ind
)
==
0
:
continue
score
=
np
.
mean
(
probs
[
valid_ind
,
ind
[
valid_ind
]])
elif
loss_type
==
"attention"
:
...
...
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