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
ModelZoo
ResNet50_onnxruntime
Commits
1b47efb3
Commit
1b47efb3
authored
Nov 07, 2023
by
yangql
Browse files
Update Src/main.cpp
parent
f1f70dc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
Src/main.cpp
Src/main.cpp
+11
-1
No files found.
Src/main.cpp
View file @
1b47efb3
...
...
@@ -69,8 +69,18 @@ int main()
while
(
currentLine
<
maxLabel
+
1
&&
std
::
getline
(
file
,
line
))
{
currentLine
++
;
}
LOG_INFO
(
stdout
,
"class=%s
;
probability=%f
\n
"
,
line
.
c_str
(),
maxConfidence
);
LOG_INFO
(
stdout
,
"class=%s
;
probability=%f
\n
"
,
line
.
c_str
(),
maxConfidence
);
//保存图像
std
::
string
text
=
std
::
string
(
"class="
)
+
line
.
c_str
();
cv
::
Point
text_position
(
5
,
20
);
int
font_face
=
cv
::
FONT_HERSHEY_SIMPLEX
;
double
font_scale
=
0.5
;
// 调整字体大小
cv
::
Scalar
font_color
(
0
,
0
,
255
);
// 白色
int
font_thickness
=
1
;
cv
::
putText
(
srcImage
,
text
,
text_position
,
font_face
,
font_scale
,
font_color
,
font_thickness
);
cv
::
imwrite
(
"./output_image.jpg"
,
srcImage
);
}
file
.
close
();
return
0
;
...
...
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