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
2ab0ba91
Commit
2ab0ba91
authored
May 26, 2021
by
LDOUBLEV
Browse files
delete debug code
parent
4ae833c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
89 deletions
+84
-89
deploy/cpp_infer/src/ocr_rec.cpp
deploy/cpp_infer/src/ocr_rec.cpp
+84
-89
No files found.
deploy/cpp_infer/src/ocr_rec.cpp
View file @
2ab0ba91
...
@@ -88,14 +88,9 @@ void CRNNRecognizer::Run(std::vector<std::vector<std::vector<int>>> boxes,
...
@@ -88,14 +88,9 @@ void CRNNRecognizer::Run(std::vector<std::vector<std::vector<int>>> boxes,
std
::
cout
<<
str_res
[
i
];
std
::
cout
<<
str_res
[
i
];
}
}
std
::
cout
<<
"
\t
score: "
<<
score
<<
std
::
endl
;
std
::
cout
<<
"
\t
score: "
<<
score
<<
std
::
endl
;
auto
box
=
boxes
[
i
];
std
::
cout
<<
"box: "
<<
box
[
0
][
0
]
<<
" "
<<
box
[
0
][
1
]
<<
" "
<<
box
[
1
][
0
]
<<
" "
<<
box
[
1
][
1
]
<<
" "
<<
box
[
2
][
0
]
<<
" "
<<
box
[
2
][
1
]
<<
" "
<<
box
[
3
][
0
]
<<
" "
<<
box
[
3
][
1
]
<<
" "
<<
std
::
endl
;
}
}
}
void
CRNNRecognizer
::
LoadModel
(
const
std
::
string
&
model_dir
)
{
void
CRNNRecognizer
::
LoadModel
(
const
std
::
string
&
model_dir
)
{
// AnalysisConfig config;
// AnalysisConfig config;
paddle_infer
::
Config
config
;
paddle_infer
::
Config
config
;
config
.
SetModel
(
model_dir
+
"/inference.pdmodel"
,
config
.
SetModel
(
model_dir
+
"/inference.pdmodel"
,
...
@@ -130,10 +125,10 @@ void CRNNRecognizer::LoadModel(const std::string &model_dir) {
...
@@ -130,10 +125,10 @@ void CRNNRecognizer::LoadModel(const std::string &model_dir) {
config
.
DisableGlogInfo
();
config
.
DisableGlogInfo
();
this
->
predictor_
=
CreatePredictor
(
config
);
this
->
predictor_
=
CreatePredictor
(
config
);
}
}
cv
::
Mat
CRNNRecognizer
::
GetRotateCropImage
(
const
cv
::
Mat
&
srcimage
,
cv
::
Mat
CRNNRecognizer
::
GetRotateCropImage
(
std
::
vector
<
std
::
vector
<
int
>>
box
)
{
const
cv
::
Mat
&
srcimage
,
std
::
vector
<
std
::
vector
<
int
>>
box
)
{
cv
::
Mat
image
;
cv
::
Mat
image
;
srcimage
.
copyTo
(
image
);
srcimage
.
copyTo
(
image
);
std
::
vector
<
std
::
vector
<
int
>>
points
=
box
;
std
::
vector
<
std
::
vector
<
int
>>
points
=
box
;
...
@@ -185,6 +180,6 @@ cv::Mat CRNNRecognizer::GetRotateCropImage(const cv::Mat &srcimage,
...
@@ -185,6 +180,6 @@ cv::Mat CRNNRecognizer::GetRotateCropImage(const cv::Mat &srcimage,
}
else
{
}
else
{
return
dst_img
;
return
dst_img
;
}
}
}
}
}
// namespace PaddleOCR
}
// namespace PaddleOCR
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