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
MIGraphX
Commits
185d0af5
Commit
185d0af5
authored
Aug 18, 2023
by
Ted Themistokleous
Browse files
Update script and add output from examples to readme.
parent
d1e7b39c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
3 deletions
+59
-3
examples/onnxruntime/resnet50/README.md
examples/onnxruntime/resnet50/README.md
+57
-1
examples/onnxruntime/resnet50/resnet50.py
examples/onnxruntime/resnet50/resnet50.py
+2
-2
No files found.
examples/onnxruntime/resnet50/README.md
View file @
185d0af5
...
...
@@ -50,7 +50,63 @@ $ pip list | grep onnxruntime
$ python resnet50.py
```
example output:
## example output:
We changes the target image to what's found in the example folder which contains three inclass images and one out of class image.
For guitars we show three different variants of the same item in a class with different backgrounds as well as background shapes
using scope.jpg. Image of an oscilliscope which is in the imagenet class labels
oscilloscope 0.99869776
radio 0.00051740184
screen 0.00044122382
monitor 8.556517e-05
tape player 5.1727424e-05
resnet50, time = 61.98 ms
using screwdrivers.jpg. Image of screwdrivers which are in the imagenet class labels
screwdriver 0.96512324
carpenter's kit 0.03258186
hammer 0.0007571124
ballpoint 0.00058690814
can opener 0.00026641905
resnet50, time = 109.67 ms
using guitar.jpg. Image of an non traditional electric guitar shape (Telecaster) which is in the imagenet class labels
electric guitar 0.4413027
acoustic guitar 0.14725313
Band Aid 0.14059556
pick 0.076821454
rule 0.020968033
resnet50, time = 77.01 ms
using guitar2.jpg. Image of a les paul stype electric guitar which is in the imagenet classes
electric guitar 0.7114628
acoustic guitar 0.23226906
banjo 0.044191252
pick 0.0056983875
stage 0.0013321621
using guitar3.jpg. Image of a super strat 7 string style electric guitar which is in the imagenet classes
electric guitar 0.71952045
prayer rug 0.08914763
banjo 0.078091994
acoustic guitar 0.056061186
violin 0.021640636
resnet50, time = 71.71 ms
using bird.jpg. Image of a cockatiel not contained in the imagenet class labels
African grey 0.5883207
kite 0.06284781
...
...
examples/onnxruntime/resnet50/resnet50.py
View file @
185d0af5
...
...
@@ -57,7 +57,7 @@ torch.onnx.export(
# Pre-processing for ResNet-50 Inferencing, from https://pytorch.org/hub/pytorch_vision_resnet/
resnet50
.
eval
()
filename
=
'
bird
.jpg'
# change to your filename
filename
=
'
guitar3
.jpg'
# change to your filename
input_image
=
Image
.
open
(
filename
)
preprocess
=
T
.
Compose
([
...
...
@@ -102,6 +102,6 @@ def run_sample(session, image_file, categories, inputs):
return
ort_outputs
ort_output
=
run_sample
(
session_fp32
,
'
bird
.jpg'
,
categories
,
input_batch
)
ort_output
=
run_sample
(
session_fp32
,
'
guitar3
.jpg'
,
categories
,
input_batch
)
print
(
"resnet50, time = {} ms"
.
format
(
format
(
sum
(
latency
)
*
1000
/
len
(
latency
),
'.2f'
)))
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