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_migraphx
Commits
23044233
Commit
23044233
authored
Nov 06, 2023
by
liucong
Browse files
修改offload为false的示例
parent
a27c38fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
Src/Classifier.cpp
Src/Classifier.cpp
+10
-0
Src/Classifier.h
Src/Classifier.h
+3
-0
No files found.
Src/Classifier.cpp
View file @
23044233
...
...
@@ -21,6 +21,16 @@ Classifier::~Classifier()
configurationFile
.
release
();
}
std
::
unordered_map
<
std
::
string
,
migraphx
::
argument
>
Classifier
::
CreateOutputData
(
migraphx
::
program
&
p
)
{
std
::
unordered_map
<
std
::
string
,
migraphx
::
argument
>
outputData
;
for
(
auto
x
:
p
.
get_outputs
())
{
outputData
[
x
.
first
]
=
migraphx
::
gpu
::
allocate_gpu
(
x
.
second
);
}
return
outputData
;
}
ErrorCode
Classifier
::
Initialize
(
InitializationParameterOfClassifier
initializationParameterOfClassifier
)
{
// 读取配置文件
...
...
Src/Classifier.h
View file @
23044233
...
...
@@ -15,6 +15,8 @@ public:
~
Classifier
();
std
::
unordered_map
<
std
::
string
,
migraphx
::
argument
>
CreateOutputData
(
migraphx
::
program
&
p
);
ErrorCode
Initialize
(
InitializationParameterOfClassifier
initializationParameterOfClassifier
);
ErrorCode
Classify
(
const
std
::
vector
<
cv
::
Mat
>
&
srcImages
,
std
::
vector
<
std
::
vector
<
ResultOfPrediction
>>
&
predictions
);
...
...
@@ -29,6 +31,7 @@ private:
bool
useInt8
;
bool
useFP16
;
bool
useoffloadcopy
;
};
...
...
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