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
7877da8f
Commit
7877da8f
authored
Jun 30, 2023
by
yangql
Browse files
Update Python/Classifier.py
parent
81c0c75a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
4 deletions
+0
-4
Python/Classifier.py
Python/Classifier.py
+0
-4
No files found.
Python/Classifier.py
View file @
7877da8f
...
@@ -2,10 +2,8 @@
...
@@ -2,10 +2,8 @@
"""
"""
分类器示例
分类器示例
"""
"""
import
cv2
import
cv2
import
numpy
as
np
import
numpy
as
np
import
onnxruntime
as
ort
import
onnxruntime
as
ort
def
Preprocessing
(
pathOfImage
):
def
Preprocessing
(
pathOfImage
):
...
@@ -44,7 +42,6 @@ def Preprocessing(pathOfImage):
...
@@ -44,7 +42,6 @@ def Preprocessing(pathOfImage):
norm_img_data
=
norm_img_data
.
reshape
(
1
,
3
,
224
,
224
).
astype
(
'float32'
)
norm_img_data
=
norm_img_data
.
reshape
(
1
,
3
,
224
,
224
).
astype
(
'float32'
)
return
norm_img_data
return
norm_img_data
def
postprocess
(
scores
):
def
postprocess
(
scores
):
'''
'''
Postprocessing with mxnet gluon
Postprocessing with mxnet gluon
...
@@ -57,7 +54,6 @@ def postprocess(scores):
...
@@ -57,7 +54,6 @@ def postprocess(scores):
a
=
np
.
argsort
(
preds
)[::
-
1
]
a
=
np
.
argsort
(
preds
)[::
-
1
]
print
(
'class=%s ; probability=%f'
%
(
labels
[
a
[
0
]],
preds
[
a
[
0
]]))
print
(
'class=%s ; probability=%f'
%
(
labels
[
a
[
0
]],
preds
[
a
[
0
]]))
def
ort_seg_dcu
(
model_path
,
image
):
def
ort_seg_dcu
(
model_path
,
image
):
#创建sess_options
#创建sess_options
...
...
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