Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wk1234123
Tengine
提交
7bc9b8b0
Tengine
项目概览
wk1234123
/
Tengine
与 Fork 源项目一致
Fork自
OAID / Tengine
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Tengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7bc9b8b0
编写于
10月 20, 2020
作者:
Z
zjd1988
提交者:
GitHub
10月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add yolov4-tiny README and modify yolov4-tiny codes (#445)
* modify src and test codes for yolov4
上级
81333494
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
13 deletion
+40
-13
examples/README.md
examples/README.md
+29
-0
examples/tm_yolov4_tiny.cpp
examples/tm_yolov4_tiny.cpp
+11
-13
未找到文件。
examples/README.md
浏览文件 @
7bc9b8b0
...
...
@@ -212,6 +212,35 @@ left = 205,right = 576,top = 153,bot = 447
![](
https://s1.ax1x.com/2020/08/28/domYCt.jpg
)
## yolov4-tiny目标检测任务 - [tm_yolov4_tiny.cpp](tm_yolov4_tiny.cpp)
使用图片:
![](
https://github.com/OAID/Tengine/blob/master/tests/images/ssd_dog.jpg
)
```
bash
$
export
LD_LIBRARY_PATH
=
./build/install/lib
$
./build/install/bin/tm_yolov4_tiny
-m
models/yolov4_tiny.tmfile
-i
images/ssd_dog.jpg
-r
1
-t
1
```
结果如下:
```
bash
start to run register cpu allocator
tengine-lite library version: 1.0-dev
Repeat 1
times
, thread 1, avg
time
177.72 ms, max_time 177.72 ms, min_time 177.72 ms
--------------------------------------
num_detections,10
16: 74%
left
=
125,right
=
327,top
=
221,bot
=
537
2: 40%
7: 84%
left
=
455,right
=
703,top
=
77,bot
=
168
1: 28%
left
=
56,right
=
603,top
=
85,bot
=
496
```
![](
https://s1.ax1x.com/2020/10/19/0zpvfU.jpg
)
## 人体姿态识别任务 - [tm_openpose.cpp](tm_openpose.cpp)
使用图片:
...
...
examples/tm_yolov4_tiny.cpp
浏览文件 @
7bc9b8b0
...
...
@@ -230,7 +230,7 @@ int yolo_num_detections(layer l, float thresh)
int
obj_index
=
entry_index
(
l
,
b
,
n
*
l
.
w
*
l
.
h
+
i
,
4
);
if
(
l
.
output
[
obj_index
]
>
thresh
)
{
printf
(
".....%d -- %f
\n
"
,
obj_index
,
l
.
output
[
obj_index
]);
//
printf(".....%d -- %f\n",obj_index, l.output[obj_index]);
++
count
;
}
}
...
...
@@ -277,16 +277,8 @@ void correct_yolo_boxes(detection* dets, int n, int w, int h, int netw, int neth
int
i
;
int
new_w
=
0
;
int
new_h
=
0
;
if
(((
float
)
netw
/
w
)
<
((
float
)
neth
/
h
))
{
new_w
=
netw
;
new_h
=
(
h
*
netw
)
/
w
;
}
else
{
new_h
=
neth
;
new_w
=
(
w
*
neth
)
/
h
;
}
new_w
=
netw
;
new_h
=
neth
;
for
(
i
=
0
;
i
<
n
;
++
i
)
{
box
b
=
dets
[
i
].
bbox
;
...
...
@@ -629,8 +621,14 @@ void get_input_data_darknet(const char* image_file, float* input_data, int net_h
{
im
.
data
[
i
]
=
im
.
data
[
i
]
/
255
;
}
sized
=
letterbox
(
im
,
net_w
,
net_h
);
memcpy
(
input_data
,
sized
.
data
,
size
*
sizeof
(
float
));
int
ow
=
net_w
;
int
oh
=
net_h
;
sized
=
resize_image
(
im
,
ow
,
oh
);
float
*
resize_data
=
(
float
*
)
sized
.
data
;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
input_data
[
i
]
=
resize_data
[
i
];
}
free_image
(
sized
);
free_image
(
im
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录