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
3aef4d98
Commit
3aef4d98
authored
Jun 13, 2023
by
liucong
Browse files
删除多余代码
parent
052429a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
67 deletions
+2
-67
CMakeLists.txt
CMakeLists.txt
+0
-1
Doc/Tutorial_Cpp.md
Doc/Tutorial_Cpp.md
+1
-1
Doc/Tutorial_Python.md
Doc/Tutorial_Python.md
+1
-1
Src/Utility/CommonUtility.cpp
Src/Utility/CommonUtility.cpp
+0
-44
Src/Utility/CommonUtility.h
Src/Utility/CommonUtility.h
+0
-20
No files found.
CMakeLists.txt
View file @
3aef4d98
...
...
@@ -37,7 +37,6 @@ link_libraries(${LIBRARY})
# 添加源文件
set
(
SOURCE_FILES
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/main.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/Classifier.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/Utility/CommonUtility.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/Utility/Filesystem.cpp
)
# 添加可执行目标
...
...
Doc/Tutorial_Cpp.md
View file @
3aef4d98
...
...
@@ -8,7 +8,7 @@
## 模型简介
本示例使用了经典的ResNet50模型,onnx文件在
/
Resource/Models/
Classifier
文件夹下,模型结构可以通过netron (https://netron.app/) 查看,该模型的输入shape为[1,3,224,224] ,数据排布为NCHW。
本示例使用了经典的ResNet50模型,onnx文件在Resource/Models/文件夹下,模型结构可以通过netron (https://netron.app/) 查看,该模型的输入shape为[1,3,224,224] ,数据排布为NCHW。
...
...
Doc/Tutorial_Python.md
View file @
3aef4d98
...
...
@@ -6,7 +6,7 @@
## 模型简介
本示例使用了经典的ResNet50模型,onnx文件在
/
Resource/Models/
Classifier
文件夹下,模型结构可以通过netron (https://netron.app/) 查看,该模型的输入shape为[1,3,224,224] ,数据排布为NCHW。
本示例使用了经典的ResNet50模型,onnx文件在Resource/Models/文件夹下,模型结构可以通过netron (https://netron.app/) 查看,该模型的输入shape为[1,3,224,224] ,数据排布为NCHW。
...
...
Src/Utility/CommonUtility.cpp
deleted
100644 → 0
View file @
052429a1
#include <CommonUtility.h>
namespace
migraphxSamples
{
bool
CompareConfidence
(
const
ResultOfDetection
&
L
,
const
ResultOfDetection
&
R
)
{
return
L
.
confidence
>
R
.
confidence
;
}
bool
CompareArea
(
const
ResultOfDetection
&
L
,
const
ResultOfDetection
&
R
)
{
return
L
.
boundingBox
.
area
()
>
R
.
boundingBox
.
area
();
}
void
NMS
(
std
::
vector
<
ResultOfDetection
>
&
detections
,
float
IOUThreshold
)
{
// sort
std
::
sort
(
detections
.
begin
(),
detections
.
end
(),
CompareConfidence
);
for
(
int
i
=
0
;
i
<
detections
.
size
();
++
i
)
{
if
(
detections
[
i
].
exist
)
{
for
(
int
j
=
i
+
1
;
j
<
detections
.
size
();
++
j
)
{
if
(
detections
[
j
].
exist
)
{
// compute IOU
float
intersectionArea
=
(
detections
[
i
].
boundingBox
&
detections
[
j
].
boundingBox
).
area
();
float
intersectionRate
=
intersectionArea
/
(
detections
[
i
].
boundingBox
.
area
()
+
detections
[
j
].
boundingBox
.
area
()
-
intersectionArea
);
if
(
intersectionRate
>
IOUThreshold
)
{
detections
[
j
].
exist
=
false
;
}
}
}
}
}
}
}
Src/Utility/CommonUtility.h
deleted
100644 → 0
View file @
052429a1
// 常用工具
#ifndef __COMMON_UTILITY_H__
#define __COMMON_UTILITY_H__
#include <CommonDefinition.h>
namespace
migraphxSamples
{
// 排序规则: 按照置信度或者按照面积排序
bool
CompareConfidence
(
const
ResultOfDetection
&
L
,
const
ResultOfDetection
&
R
);
bool
CompareArea
(
const
ResultOfDetection
&
L
,
const
ResultOfDetection
&
R
);
// 非极大抑制
void
NMS
(
std
::
vector
<
ResultOfDetection
>
&
detections
,
float
IOUThreshold
);
}
#endif
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