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
gaoqiong
RapidOCR
Commits
99ac0d4a
Commit
99ac0d4a
authored
Oct 19, 2022
by
benjaminwan
Browse files
再次修复空格问题
parent
5e1c7a08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/CrnnNet.cpp
src/CrnnNet.cpp
+6
-2
No files found.
src/CrnnNet.cpp
View file @
99ac0d4a
...
...
@@ -78,7 +78,8 @@ inline static size_t argmax(ForwardIterator first, ForwardIterator last) {
}
TextLine
CrnnNet
::
scoreToTextLine
(
const
std
::
vector
<
float
>
&
outputData
,
int
h
,
int
w
)
{
int
keySize
=
keys
.
size
();
auto
keySize
=
keys
.
size
();
auto
dataSize
=
outputData
.
size
();
std
::
string
strRes
;
std
::
vector
<
float
>
scores
;
int
lastIndex
=
0
;
...
...
@@ -87,7 +88,10 @@ TextLine CrnnNet::scoreToTextLine(const std::vector<float> &outputData, int h, i
for
(
int
i
=
0
;
i
<
h
;
i
++
)
{
int
start
=
i
*
w
;
int
stop
=
(
i
+
1
)
*
w
-
1
;
int
stop
=
(
i
+
1
)
*
w
;
if
(
stop
>
dataSize
-
1
)
{
stop
=
(
i
+
1
)
*
w
-
1
;
}
maxIndex
=
int
(
argmax
(
&
outputData
[
start
],
&
outputData
[
stop
]));
maxValue
=
float
(
*
std
::
max_element
(
&
outputData
[
start
],
&
outputData
[
stop
]));
...
...
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