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
YOLOv8_migraphx
Commits
e7dd6859
Commit
e7dd6859
authored
Dec 14, 2023
by
yaoht
Browse files
fix README.md
parent
b603f385
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
16 deletions
+17
-16
Doc/Tutorial_Cpp.md
Doc/Tutorial_Cpp.md
+12
-12
Doc/Tutorial_Python.md
Doc/Tutorial_Python.md
+2
-1
README.md
README.md
+3
-3
Resource/Images/Result0_python.jpg
Resource/Images/Result0_python.jpg
+0
-0
Resource/Images/Result1_python.jpg
Resource/Images/Result1_python.jpg
+0
-0
Resource/Images/Result_python.jpg
Resource/Images/Result_python.jpg
+0
-0
No files found.
Doc/Tutorial_Cpp.md
View file @
e7dd6859
...
@@ -40,10 +40,10 @@ samples工程中的Resource/Configuration.xml文件的DetectorYOLOV8节点表示
...
@@ -40,10 +40,10 @@ samples工程中的Resource/Configuration.xml文件的DetectorYOLOV8节点表示
ErrorCode
DetectorYOLOV8
::
Initialize
(
InitializationParameterOfDetector
initializationParameterOfDetector
,
bool
dynamic
)
ErrorCode
DetectorYOLOV8
::
Initialize
(
InitializationParameterOfDetector
initializationParameterOfDetector
,
bool
dynamic
)
{
{
...
...
// 加载模型
// 加载模型
net
=
migraphx
::
parse_onnx
(
modelPath
);
net
=
migraphx
::
parse_onnx
(
modelPath
);
LOG_INFO
(
stdout
,
"succeed to load model: %s
\n
"
,
GetFileName
(
modelPath
).
c_str
());
LOG_INFO
(
stdout
,
"succeed to load model: %s
\n
"
,
GetFileName
(
modelPath
).
c_str
());
...
...
}
}
...
@@ -54,12 +54,12 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ
...
@@ -54,12 +54,12 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ
```
cpp
```
cpp
ErrorCode
DetectorYOLOV8
::
Initialize
(
InitializationParameterOfDetector
initializationParameterOfDetector
,
bool
dynamic
)
ErrorCode
DetectorYOLOV8
::
Initialize
(
InitializationParameterOfDetector
initializationParameterOfDetector
,
bool
dynamic
)
{
{
...
...
migraphx
::
onnx_options
onnx_options
;
migraphx
::
onnx_options
onnx_options
;
onnx_options
.
map_input_dims
[
"images"
]
=
{
1
,
3
,
1024
,
1024
};
//
onnx_options
.
map_input_dims
[
"images"
]
=
{
1
,
3
,
1024
,
1024
};
//
net
=
migraphx
::
parse_onnx
(
modelPath
,
onnx_options
);
net
=
migraphx
::
parse_onnx
(
modelPath
,
onnx_options
);
...
...
}
}
```
```
...
@@ -77,9 +77,9 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ
...
@@ -77,9 +77,9 @@ ErrorCode DetectorYOLOV8::Initialize(InitializationParameterOfDetector initializ
```
cpp
```
cpp
ErrorCode
DetectorYOLOV8
::
Detect
(
const
cv
::
Mat
&
srcImage
,
std
::
vector
<
std
::
size_t
>
&
relInputShape
,
std
::
vector
<
ResultOfDetection
>
&
resultsOfDetection
,
bool
dynamic
)
ErrorCode
DetectorYOLOV8
::
Detect
(
const
cv
::
Mat
&
srcImage
,
std
::
vector
<
std
::
size_t
>
&
relInputShape
,
std
::
vector
<
ResultOfDetection
>
&
resultsOfDetection
,
bool
dynamic
)
{
{
...
...
// 数据预处理并转换为NCHW格式
// 数据预处理并转换为NCHW格式
inputSize
=
cv
::
Size
(
relInputShape
[
3
],
relInputShape
[
2
]);
inputSize
=
cv
::
Size
(
relInputShape
[
3
],
relInputShape
[
2
]);
cv
::
Mat
inputBlob
;
cv
::
Mat
inputBlob
;
cv
::
dnn
::
blobFromImage
(
srcImage
,
cv
::
dnn
::
blobFromImage
(
srcImage
,
...
...
Doc/Tutorial_Python.md
View file @
e7dd6859
...
@@ -20,7 +20,8 @@ YOLOV8是一种单阶段目标检测算法,该算法在YOLOV5的基础上添
...
@@ -20,7 +20,8 @@ YOLOV8是一种单阶段目标检测算法,该算法在YOLOV5的基础上添
def
preprocess
(
self
,
image
):
def
preprocess
(
self
,
image
):
"""
"""
Preprocesses the input image before performing inference.
Preprocesses the input image before performing inference.
Args:
image: image to preprocess.
Returns:
Returns:
image_data: Preprocessed image data ready for inference.
image_data: Preprocessed image data ready for inference.
"""
"""
...
...
README.md
View file @
e7dd6859
...
@@ -151,15 +151,15 @@ cd build/
...
@@ -151,15 +151,15 @@ cd build/
python程序运行结束后,会在当前目录生成YOLOV8静态推理检测结果可视化图像。
python程序运行结束后,会在当前目录生成YOLOV8静态推理检测结果可视化图像。
<img
src=
"./
Python/Result
.jpg"
alt=
"Result"
style=
"zoom: 50%;"
/>
<img
src=
"./
Resource/Images/Result_python
.jpg"
alt=
"Result"
style=
"zoom: 50%;"
/>
动态推理:
动态推理:
python程序运行结束后,会在当前目录生成YoloV8动态推理检测结果可视化图像。
python程序运行结束后,会在当前目录生成YoloV8动态推理检测结果可视化图像。
<img
src=
"./
Python
/Result0.jpg"
alt=
"Result_2"
style=
"zoom: 50%;"
/>
<img
src=
"./
Resource/Images
/Result0
_python
.jpg"
alt=
"Result_2"
style=
"zoom: 50%;"
/>
<img
src=
"./
Python
/Result1.jpg"
alt=
"Result1"
style=
"zoom: 50%;"
/>
<img
src=
"./
Resource/Images
/Result1
_python
.jpg"
alt=
"Result1"
style=
"zoom: 50%;"
/>
### C++版本
### C++版本
...
...
Python
/Result0.jpg
→
Resource/Images
/Result0
_python
.jpg
View file @
e7dd6859
File moved
Python
/Result1.jpg
→
Resource/Images
/Result1
_python
.jpg
View file @
e7dd6859
File moved
Python/Result
.jpg
→
Resource/Images/Result_python
.jpg
View file @
e7dd6859
File moved
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