提交 5f92dd25 authored 作者: blu's avatar blu

object detection

上级 352c9446
...@@ -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
...@@ -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(...) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论