Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
5f92dd25
提交
5f92dd25
authored
12月 26, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
object detection
上级
352c9446
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
5 行删除
+8
-5
main.cpp
opencv-yolo/main.cpp
+6
-3
yolo.hpp
opencv-yolo/yolo.hpp
+2
-2
没有找到文件。
opencv-yolo/main.cpp
浏览文件 @
5f92dd25
...
@@ -11,12 +11,14 @@ int main(int argc, char *argv[]){
...
@@ -11,12 +11,14 @@ int main(int argc, char *argv[]){
bool
bVerbose
=
false
;
bool
bVerbose
=
false
;
bool
help
=
false
;
bool
help
=
false
;
bool
bCont
=
false
;
bool
bCont
=
false
;
int
wrap
=
10
;
string
sInput
,
sOutput
=
"detect.jpg"
;
string
sInput
,
sOutput
=
"detect.jpg"
;
string
modelPath
=
"."
;
string
modelPath
=
"."
;
auto
cli
=
(
auto
cli
=
(
value
(
"input path"
,
sInput
),
value
(
"input path"
,
sInput
),
option
(
"-cl"
)
&
value
(
"confidence level of detection, default: 0.1"
,
fConfident
),
option
(
"-cl"
)
&
value
(
"confidence level of detection, default: 0.1"
,
fConfident
),
option
(
"-w"
,
"--wrap"
)
&
value
(
"output file wrap. defualt: 10; 0 - no wrap"
,
wrap
),
option
(
"-vv"
,
"--debug"
).
set
(
bVerbose
).
doc
(
"verbose prints"
),
option
(
"-vv"
,
"--debug"
).
set
(
bVerbose
).
doc
(
"verbose prints"
),
option
(
"-human"
,
"--human-only"
)
&
value
(
"detect only human object, default: true"
,
bHumanOnly
),
option
(
"-human"
,
"--human-only"
)
&
value
(
"detect only human object, default: true"
,
bHumanOnly
),
option
(
"-c"
,
"--config-path"
)
&
value
(
"model and configuration path"
,
modelPath
),
option
(
"-c"
,
"--config-path"
)
&
value
(
"model and configuration path"
,
modelPath
),
...
@@ -31,12 +33,12 @@ int main(int argc, char *argv[]){
...
@@ -31,12 +33,12 @@ int main(int argc, char *argv[]){
spdlog
::
info
(
s
.
str
());
spdlog
::
info
(
s
.
str
());
exit
(
0
);
exit
(
0
);
}
}
spdlog
::
info
(
"{} {}
"
,
bHumanOnly
,
fConfident
);
spdlog
::
info
(
"{} {}
{}"
,
bHumanOnly
,
fConfident
,
wrap
);
if
(
bVerbose
)
{
if
(
bVerbose
)
{
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
}
}
YoloDectect
detector
(
modelPath
,
bHumanOnly
==
"true"
?
true
:
false
,
fConfident
,
bCont
);
YoloDectect
detector
(
modelPath
,
bHumanOnly
==
"true"
?
true
:
false
,
fConfident
,
bCont
,
wrap
);
detector
.
process
(
sInput
,
sOutput
);
detector
.
process
(
sInput
,
sOutput
);
}
}
\ No newline at end of file
opencv-yolo/yolo.hpp
浏览文件 @
5f92dd25
...
@@ -226,7 +226,7 @@ public:
...
@@ -226,7 +226,7 @@ public:
}
}
try
{
try
{
if
(
inVideoUri
.
substr
(
inVideoUri
.
find_last_of
(
"."
)
+
1
)
==
"mp4"
||
(
cameNo
=
stoi
(
inVideoUri
))
>=
0
)
{
if
(
inVideoUri
.
substr
(
0
,
4
)
==
"rtsp"
||
inVideoUri
.
substr
(
0
,
4
)
==
"rtmp"
||
inVideoUri
.
substr
(
inVideoUri
.
find_last_of
(
"."
)
+
1
)
==
"mp4"
||
(
cameNo
=
stoi
(
inVideoUri
))
>=
0
)
{
bInputIsImage
=
false
;
bInputIsImage
=
false
;
}
}
}
catch
(...)
{
}
catch
(...)
{
...
@@ -330,7 +330,7 @@ public:
...
@@ -330,7 +330,7 @@ public:
if
(
wrapNum
>
0
)
{
if
(
wrapNum
>
0
)
{
detCnt
=
detCnt
%
wrapNum
;
detCnt
=
detCnt
%
wrapNum
;
}
}
string
ofname
=
outFileBase
+
to_string
(
detCnt
)
+
".jpg"
;
string
ofname
=
outFileBase
+
to_string
(
detCnt
)
+
".jpg"
;
imwrite
(
ofname
,
outFrame
);
imwrite
(
ofname
,
outFrame
);
string
msg
=
fmt
::
format
(
"{} found {} {}:
\n
"
,
selfId
,
ret
.
size
(),
ofname
);
string
msg
=
fmt
::
format
(
"{} found {} {}:
\n
"
,
selfId
,
ret
.
size
(),
ofname
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论