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
02c89987
Commit
02c89987
authored
Oct 16, 2022
by
benjaminwan
Browse files
fix: rec字典添加空格
parent
9ccb4089
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/CrnnNet.cpp
src/CrnnNet.cpp
+4
-1
No files found.
src/CrnnNet.cpp
View file @
02c89987
...
@@ -57,6 +57,9 @@ void CrnnNet::initModel(const std::string &pathStr, const std::string &keysPath)
...
@@ -57,6 +57,9 @@ void CrnnNet::initModel(const std::string &pathStr, const std::string &keysPath)
printf
(
"The keys.txt file was not found
\n
"
);
printf
(
"The keys.txt file was not found
\n
"
);
return
;
return
;
}
}
keys
.
insert
(
keys
.
begin
(),
"#"
);
keys
.
emplace_back
(
" "
);
printf
(
"total keys size(%lu)
\n
"
,
keys
.
size
());
}
}
template
<
class
ForwardIterator
>
template
<
class
ForwardIterator
>
...
@@ -78,7 +81,7 @@ TextLine CrnnNet::scoreToTextLine(const std::vector<float> &outputData, int h, i
...
@@ -78,7 +81,7 @@ TextLine CrnnNet::scoreToTextLine(const std::vector<float> &outputData, int h, i
if
(
maxIndex
>
0
&&
maxIndex
<
keySize
&&
(
!
(
i
>
0
&&
maxIndex
==
lastIndex
)))
{
if
(
maxIndex
>
0
&&
maxIndex
<
keySize
&&
(
!
(
i
>
0
&&
maxIndex
==
lastIndex
)))
{
scores
.
emplace_back
(
maxValue
);
scores
.
emplace_back
(
maxValue
);
strRes
.
append
(
keys
[
maxIndex
-
1
]);
strRes
.
append
(
keys
[
maxIndex
]);
}
}
lastIndex
=
maxIndex
;
lastIndex
=
maxIndex
;
}
}
...
...
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