update 修改标签检测模型名,精简参数设置

dev_lsy
liusiyang 3 weeks ago
parent 0b420a8476
commit 53878afe4f

@ -160,7 +160,7 @@ int AIFactory::InitALLAIModle(GPU_Config gupconfig)
AI_defect_Tag = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config boe_config;
boe_config.gpuconfig.copy(gupconfig);
boe_config.strPath = "/home/aidlux/BOE/UseModel_FOG/defect_L127.engine";
boe_config.strPath = "/home/aidlux/BOE/UseModel_FOG/defect_Tag.engine";
boe_config.strName = "tag";
boe_config.inputType = AIModel_Base::Input_CHW;
AI_defect_Tag->Init(boe_config);

@ -26,7 +26,7 @@
// resize 图片的 宽度
#define RESIZE_IMAGE_WIDTH 1680
// #define AI_Time
#define AI_Time
enum TEM_IMG_IDX_
{

@ -129,11 +129,11 @@ int AI_Edge_QX_Det::Detect(const cv::Mat &img, cv::Mat &detmask, DetConfig *pDet
m_pdetlog = pdetlog;
if (pDetConfig->ninstruct == 767)
{
// nRuntype = 1;
nRuntype = 1;
}
else if (pDetConfig->ninstruct == 768)
{
// nRuntype = 2;
nRuntype = 2;
}
bool bdege = false;

@ -697,7 +697,13 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptr<I
long ts = CheckUtil::getcurTime();
m_pCheck_Result->cameraBaseResult->pBQ_Result = std::make_shared<BQ_Result>();
m_pCheck_Result->cameraBaseResult->pBQ_Result->bShield_BQ = m_AnalysisyConfig.commonCheckConfig.baseConfig.bShield_BQ;
m_pCheck_Result->cameraBaseResult->pBQ_Result->bBQ_AI_Det = m_pbaseCheckFunction->Det_BQ.bBQ_AI_Det;
// Det_BQ 已从 Base 层移至 Channel 层
ChannelCheckFunction *pChannelFuntion_BQ = GetChannelFuntion(L255->strChannel);
if (pChannelFuntion_BQ)
{
m_pCheck_Result->cameraBaseResult->pBQ_Result->bBQ_AI_Det = pChannelFuntion_BQ->function.f_Det_BQ.bBQ_AI_Det;
}
cv::Rect Det_CropRoi = m_pCheck_Result->cameraBaseResult->pEdgeDetResult->cutRoi;
@ -726,7 +732,7 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptr<I
for (int i = 0; i < m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_roiList.size(); i++)
{
cv::Rect boundingRect = m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_roiList.at(i);
int BQ_expand = m_pbaseCheckFunction->Det_BQ.BQ_expand;
int BQ_expand = pChannelFuntion_BQ ? pChannelFuntion_BQ->function.f_Det_BQ.BQ_expand : 0;
boundingRect.x -= BQ_expand;
boundingRect.y -= BQ_expand;
boundingRect.width += 2 * BQ_expand;
@ -738,7 +744,7 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptr<I
detImg_mask(boundingRect).setTo(255);
// 保存裁剪图像供独立BQ AI检测
if (m_pbaseCheckFunction->Det_BQ.bBQ_AI_Det)
if (pChannelFuntion_BQ && pChannelFuntion_BQ->function.f_Det_BQ.bBQ_AI_Det)
{
m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_expandedRoiList.push_back(boundingRect);
cv::Mat bqCrop = L255CutImg(boundingRect).clone();

@ -170,7 +170,7 @@ int ImgCheckAnalysisy::GetStatus()
std::string ImgCheckAnalysisy::GetVersion()
{
return std::string("BOE_1.3.0_" + std::string(__DATE__) + "_" + std::string(__TIME__));
return std::string("BOE_1.3.1_" + std::string(__DATE__) + "_" + std::string(__TIME__));
}
std::string ImgCheckAnalysisy::GetErrorInfo()

@ -1719,6 +1719,41 @@ struct Function_Edge_Det
return str123;
}
};
struct Function_Det_BQ
{
bool bBQ_AI_Det; // 是否启用标签独立AI检测
int BQ_expand;
Function_Det_BQ()
{
Init();
}
void Init()
{
BQ_expand = 0;
bBQ_AI_Det = false;
}
void copy(Function_Det_BQ tem)
{
this->BQ_expand = tem.BQ_expand;
this->bBQ_AI_Det = tem.bBQ_AI_Det;
}
void print(std::string str)
{
printf("%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(),
BQ_expand, bBQ_AI_Det);
}
std::string GetInfo(std::string str)
{
char buffer[256];
sprintf(buffer, "%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(),
BQ_expand, bBQ_AI_Det);
std::string str123 = buffer;
return str123;
}
};
// 检测功能
struct CheckFunction
{
@ -1738,6 +1773,7 @@ struct CheckFunction
Function_AD_Check f_AD_Check; // 暗点的检测功能
Function_POL_Check f_POL_Check; // 异物的检测功能
Function_Edge_Det f_dege_Det;
Function_Det_BQ f_Det_BQ;
CheckFunction()
{
Init();
@ -1760,6 +1796,7 @@ struct CheckFunction
f_AD_Check.Init();
f_POL_Check.Init();
f_dege_Det.Init();
f_Det_BQ.Init();
}
void copy(CheckFunction tem)
{
@ -1780,6 +1817,7 @@ struct CheckFunction
this->f_AD_Check.copy(tem.f_AD_Check);
this->f_POL_Check.copy(tem.f_POL_Check);
this->f_dege_Det.copy(tem.f_dege_Det);
this->f_Det_BQ.copy(tem.f_Det_BQ);
}
void print(std::string str)
{
@ -1800,6 +1838,7 @@ struct CheckFunction
f_AD_Check.print("f_AD_Check");
f_POL_Check.print("f_POL_Check");
f_dege_Det.print("f_dege_Det");
f_Det_BQ.print("f_Det_BQ");
}
std::string GetInfo(std::string str)
{
@ -1821,6 +1860,7 @@ struct CheckFunction
str123 += f_AD_Check.GetInfo("f_AD_Check");
str123 += f_POL_Check.GetInfo("f_POL_Check");
str123 += f_dege_Det.GetInfo("f_dege_Det");
str123 += f_Det_BQ.GetInfo("f_Det_BQ");
return str123;
}
};
@ -2261,40 +2301,6 @@ struct Base_Function_AD_Check
}
};
struct Base_Function_Det_BQ
{
int BQ_expand;
bool bBQ_AI_Det; // 是否启用标签独立AI检测汇入主流程分类
Base_Function_Det_BQ()
{
Init();
}
void Init()
{
BQ_expand = 0;
bBQ_AI_Det = false;
}
void copy(Base_Function_Det_BQ tem)
{
this->BQ_expand = tem.BQ_expand;
this->bBQ_AI_Det = tem.bBQ_AI_Det;
}
void print(std::string str)
{
printf("%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(),
BQ_expand, bBQ_AI_Det);
}
std::string GetInfo(std::string str)
{
char buffer[256];
sprintf(buffer, "%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(),
BQ_expand, bBQ_AI_Det);
std::string str123 = buffer;
return str123;
}
};
// 基础检测功能
struct BaseCheckFunction
{
@ -2304,7 +2310,6 @@ struct BaseCheckFunction
Base_Function_BigNG bigNG;
Base_Function_EdgeChannel edgeChannel;
Base_Function_AD_Check ad_check;
Base_Function_Det_BQ Det_BQ;
BaseCheckFunction()
{
Init();
@ -2317,7 +2322,6 @@ struct BaseCheckFunction
bigNG.Init();
edgeChannel.Init();
ad_check.Init();
Det_BQ.Init();
}
void copy(BaseCheckFunction tem)
{
@ -2327,7 +2331,6 @@ struct BaseCheckFunction
this->bigNG.copy(tem.bigNG);
this->edgeChannel.copy(tem.edgeChannel);
this->ad_check.copy(tem.ad_check);
this->Det_BQ.copy(tem.Det_BQ);
}
void print(std::string str)
{
@ -2338,7 +2341,6 @@ struct BaseCheckFunction
bigNG.print("bigNG");
edgeChannel.print("edgeChannel");
ad_check.print("ad_check");
Det_BQ.print("Det_BQ");
}
std::string GetInfo(std::string str)
{
@ -2349,7 +2351,6 @@ struct BaseCheckFunction
str123 += bigNG.GetInfo("bigNG");
str123 += edgeChannel.GetInfo("edgeChannel");
str123 += ad_check.GetInfo("ad_check");
str123 += Det_BQ.GetInfo("Det_BQ");
// str123 += "\n";
return str123;
}

@ -1111,6 +1111,20 @@ int ChannelFuntonConfigJson::GetFunction(Json::Value value, CheckFunction &funct
// function.f_markDet.print("UpQX");
// getchar();
}
// 标签配置参数
if ("Det_BQ" == strCode)
{
auto value_f = value;
// std::cout << value_f << std::endl;
// getchar();
function.f_Det_BQ.bBQ_AI_Det = value_f["isOpen"].asBool();
{
if (value_f["form"]["BQ_Param"]["BQ_expand"])
{
function.f_Det_BQ.BQ_expand = value_f["form"]["BQ_Param"]["BQ_expand"].asInt();
}
}
}
}
}
return 0;
@ -1471,21 +1485,5 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value)
_config.ad_check.Init();
}
}
// 标签配置参数
if ("Det_BQ" == strCode)
{
auto value_f = value;
// std::cout << value_f << std::endl;
// getchar();
_config.Det_BQ.bBQ_AI_Det = value_f["isOpen"].asBool();
{
if (value_f["form"]["bShield_BQ"]["BQ_expand"])
{
_config.Det_BQ.BQ_expand = value_f["form"]["bShield_BQ"]["BQ_expand"].asInt();
}
}
// _config.edgeDet.print("edgeDet");
// getchar();
}
return 0;
}

Loading…
Cancel
Save