feat 离线程序添加-tag

dev_lsy
liusiyang 3 weeks ago
parent 530ba7b3bf
commit 085e06bb87

@ -64,6 +64,8 @@ public:
int GetConfig(ALLChannelCheckFunction &config);
int GetFunction(Json::Value value, CheckFunction &function);
static bool s_bDetTag; // 标签检测模式标志,由命令行 -tag 参数控制
private:
ALLChannelCheckFunction _config;
};

@ -1,5 +1,8 @@
#include "JsonConfig.h"
// 静态成员定义:标签检测模式标志
bool ChannelFuntonConfigJson::s_bDetTag = false;
Json::Value CommonParamJson::toJsonValue()
{
return Json::Value();
@ -1128,6 +1131,13 @@ int ChannelFuntonConfigJson::GetFunction(Json::Value value, CheckFunction &funct
function.f_Det_BQ.bsaveAll = value_f["form"]["BQ_Param"]["bsaveAll"].asBool();
}
}
// 当 -tag 参数启用时,强制开启标签 AI 检测和保存所有中间结果
if (s_bDetTag)
{
function.f_Det_BQ.bBQ_AI_Det = true;
function.f_Det_BQ.bsaveAll = true;
}
}
}
}

@ -8,6 +8,7 @@
#include <string>
#include "CheckUtil.hpp"
#include "LoadImage.hpp" // #include "LoadImage.h"
#include "JsonConfig.h"
bool check_strChannel(string strChannel){
if(strChannel == "XD" || strChannel == "XON") return false;
@ -261,6 +262,9 @@ int deal::Init()
// 初始化参数模块
InitConfig();
// 设置标签检测模式标志,供 ChannelFuntonConfigJson 在解析 JSON 时使用
ChannelFuntonConfigJson::s_bDetTag = runConfig.det_Tag;
printf("\n\n\n\n\n\n\n\n\n\n\n**********************************************************LoadCheckImgConfig\n");
// 载入参数
re = LoadCheckImgConfig();

@ -545,6 +545,7 @@ struct DealRunConfig
Process_Run_Type run_Type = Process_Run_Detect; // 运行模式
RUNTYPE_ det_Type = RUNTYPE_RUN_Pre; // 处理
std::string filePath = ""; // 处理文件路径 如果为空 处理当前的单张图片
bool det_Tag = false; // 是否检测标签
bool bDebugSaveImg = false; // 是否中间图片图片
int m_nTestNum = 999999;
void print(std::string str)

@ -228,7 +228,12 @@ int main(int argc, char *argv[])
return 0;
}
}
else if (string(argv[i]) == "-tag" && i + 1 < argc)
{
test.runConfig.det_Type = RUNTYPE_RUN_File;
test.runConfig.filePath = string(argv[i + 1]);
test.runConfig.det_Tag = true;
}
if (string(argv[i]) == "-s")
{
test.runConfig.bDebugSaveImg = true;

Loading…
Cancel
Save