Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
40d58469
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
40d58469
编写于
6月 02, 2022
作者:
G
Guanghua Yu
提交者:
GitHub
6月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix picodet output name in openvino demo (#6114)
上级
c103d025
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
53 addition
and
59 deletion
+53
-59
deploy/third_engine/demo_openvino/picodet_openvino.h
deploy/third_engine/demo_openvino/picodet_openvino.h
+39
-42
deploy/third_engine/demo_openvino_kpts/picodet_openvino.h
deploy/third_engine/demo_openvino_kpts/picodet_openvino.h
+14
-17
未找到文件。
deploy/third_engine/demo_openvino/picodet_openvino.h
浏览文件 @
40d58469
...
...
@@ -13,66 +13,63 @@
// limitations under the License.
// reference from https://github.com/RangiLyu/nanodet/tree/main/demo_openvino
#ifndef _PICODET_OPENVINO_H_
#define _PICODET_OPENVINO_H_
#include <string>
#include <opencv2/core.hpp>
#include <inference_engine.hpp>
#include <opencv2/core.hpp>
#include <string>
#define image_size 416
typedef
struct
HeadInfo
{
std
::
string
cls_layer
;
std
::
string
dis_layer
;
int
stride
;
typedef
struct
HeadInfo
{
std
::
string
cls_layer
;
std
::
string
dis_layer
;
int
stride
;
}
HeadInfo
;
typedef
struct
BoxInfo
{
float
x1
;
float
y1
;
float
x2
;
float
y2
;
float
score
;
int
label
;
typedef
struct
BoxInfo
{
float
x1
;
float
y1
;
float
x2
;
float
y2
;
float
score
;
int
label
;
}
BoxInfo
;
class
PicoDet
{
class
PicoDet
{
public:
PicoDet
(
const
char
*
param
);
PicoDet
(
const
char
*
param
);
~
PicoDet
();
~
PicoDet
();
InferenceEngine
::
ExecutableNetwork
network_
;
InferenceEngine
::
InferRequest
infer_request_
;
// static bool hasGPU;
InferenceEngine
::
ExecutableNetwork
network_
;
InferenceEngine
::
InferRequest
infer_request_
;
// static bool hasGPU;
std
::
vector
<
HeadInfo
>
heads_info_
{
// cls_pred|dis_pred|stride
{
"save_infer_model/scale_0.tmp_1"
,
"save_infer_model/scale_4.tmp_1
"
,
8
},
{
"save_infer_model/scale_1.tmp_1"
,
"save_infer_model/scale_5.tmp_1
"
,
16
},
{
"save_infer_model/scale_2.tmp_1"
,
"save_infer_model/scale_6.tmp_1
"
,
32
},
{
"save_infer_model/scale_3.tmp_1"
,
"save_infer_model/scale_7.tmp_1
"
,
64
},
};
std
::
vector
<
HeadInfo
>
heads_info_
{
// cls_pred|dis_pred|stride
{
"transpose_0.tmp_0"
,
"transpose_1.tmp_0
"
,
8
},
{
"transpose_2.tmp_0"
,
"transpose_3.tmp_0
"
,
16
},
{
"transpose_4.tmp_0"
,
"transpose_5.tmp_0
"
,
32
},
{
"transpose_6.tmp_0"
,
"transpose_7.tmp_0
"
,
64
},
};
std
::
vector
<
BoxInfo
>
detect
(
cv
::
Mat
image
,
float
score_threshold
,
float
nms_threshold
);
std
::
vector
<
BoxInfo
>
detect
(
cv
::
Mat
image
,
float
score_threshold
,
float
nms_threshold
);
private:
void
preprocess
(
cv
::
Mat
&
image
,
InferenceEngine
::
Blob
::
Ptr
&
blob
);
void
decode_infer
(
const
float
*&
cls_pred
,
const
float
*&
dis_pred
,
int
stride
,
float
threshold
,
std
::
vector
<
std
::
vector
<
BoxInfo
>>&
results
);
BoxInfo
disPred2Bbox
(
const
float
*&
dfl_det
,
int
label
,
float
score
,
int
x
,
int
y
,
int
stride
);
static
void
nms
(
std
::
vector
<
BoxInfo
>&
result
,
float
nms_threshold
);
std
::
string
input_name_
;
int
input_size_
=
image_size
;
int
num_class_
=
80
;
int
reg_max_
=
7
;
void
preprocess
(
cv
::
Mat
&
image
,
InferenceEngine
::
Blob
::
Ptr
&
blob
);
void
decode_infer
(
const
float
*&
cls_pred
,
const
float
*&
dis_pred
,
int
stride
,
float
threshold
,
std
::
vector
<
std
::
vector
<
BoxInfo
>>
&
results
);
BoxInfo
disPred2Bbox
(
const
float
*&
dfl_det
,
int
label
,
float
score
,
int
x
,
int
y
,
int
stride
);
static
void
nms
(
std
::
vector
<
BoxInfo
>
&
result
,
float
nms_threshold
);
std
::
string
input_name_
;
int
input_size_
=
image_size
;
int
num_class_
=
80
;
int
reg_max_
=
7
;
};
#endif
deploy/third_engine/demo_openvino_kpts/picodet_openvino.h
浏览文件 @
40d58469
...
...
@@ -38,8 +38,8 @@ typedef struct BoxInfo {
}
BoxInfo
;
class
PicoDet
{
public:
PicoDet
(
const
char
*
param
);
public:
PicoDet
(
const
char
*
param
);
~
PicoDet
();
...
...
@@ -48,26 +48,23 @@ class PicoDet {
std
::
vector
<
HeadInfo
>
heads_info_
{
// cls_pred|dis_pred|stride
{
"
save_infer_model/scale_0.tmp_1"
,
"save_infer_model/scale_4.tmp_1
"
,
8
},
{
"
save_infer_model/scale_1.tmp_1"
,
"save_infer_model/scale_5.tmp_1
"
,
16
},
{
"
save_infer_model/scale_2.tmp_1"
,
"save_infer_model/scale_6.tmp_1
"
,
32
},
{
"
save_infer_model/scale_3.tmp_1"
,
"save_infer_model/scale_7.tmp_1
"
,
64
},
{
"
transpose_0.tmp_0"
,
"transpose_1.tmp_0
"
,
8
},
{
"
transpose_2.tmp_0"
,
"transpose_3.tmp_0
"
,
16
},
{
"
transpose_4.tmp_0"
,
"transpose_5.tmp_0
"
,
32
},
{
"
transpose_6.tmp_0"
,
"transpose_7.tmp_0
"
,
64
},
};
std
::
vector
<
BoxInfo
>
detect
(
cv
::
Mat
image
,
float
score_threshold
,
std
::
vector
<
BoxInfo
>
detect
(
cv
::
Mat
image
,
float
score_threshold
,
float
nms_threshold
);
private:
void
preprocess
(
cv
::
Mat
&
image
,
InferenceEngine
::
Blob
::
Ptr
&
blob
);
void
decode_infer
(
const
float
*&
cls_pred
,
const
float
*&
dis_pred
,
int
stride
,
private:
void
preprocess
(
cv
::
Mat
&
image
,
InferenceEngine
::
Blob
::
Ptr
&
blob
);
void
decode_infer
(
const
float
*&
cls_pred
,
const
float
*&
dis_pred
,
int
stride
,
float
threshold
,
std
::
vector
<
std
::
vector
<
BoxInfo
>>
&
results
);
BoxInfo
disPred2Bbox
(
const
float
*&
dfl_det
,
int
label
,
float
score
,
int
x
,
int
y
,
int
stride
);
static
void
nms
(
std
::
vector
<
BoxInfo
>
&
result
,
float
nms_threshold
);
std
::
vector
<
std
::
vector
<
BoxInfo
>>
&
results
);
BoxInfo
disPred2Bbox
(
const
float
*&
dfl_det
,
int
label
,
float
score
,
int
x
,
int
y
,
int
stride
);
static
void
nms
(
std
::
vector
<
BoxInfo
>
&
result
,
float
nms_threshold
);
std
::
string
input_name_
;
int
input_size_
=
image_size
;
int
num_class_
=
80
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录