update 修改模型读取路径,添加暗场模型

dev_lsy
liusiyang 2 weeks ago
parent e102fc5edd
commit ae6cfc95c1

@ -170,8 +170,10 @@ public:
std::shared_ptr<AIModel_Base> CELL_Mark; std::shared_ptr<AIModel_Base> CELL_Mark;
std::shared_ptr<AIModel_Base> CELL_Align; std::shared_ptr<AIModel_Base> CELL_Align;
std::shared_ptr<AIModel_Base> CELL_CA_Det; std::shared_ptr<AIModel_Base> CELL_BCA_Det;
std::shared_ptr<AIModel_Base> CELL_TA_Det; std::shared_ptr<AIModel_Base> CELL_BTA_Det;
std::shared_ptr<AIModel_Base> CELL_DCA_Det;
std::shared_ptr<AIModel_Base> CELL_DTA_Det;
std::shared_ptr<AIModel_Base> CELL_CA_Cls; std::shared_ptr<AIModel_Base> CELL_CA_Cls;
std::shared_ptr<AIModel_Base> CELL_TA_Cls; std::shared_ptr<AIModel_Base> CELL_TA_Cls;

@ -37,34 +37,56 @@ int AIFactory::InitALLAIModle(GPU_Config gupconfig)
return 1; return 1;
} }
if (!CELL_CA_Det) if (!CELL_BCA_Det)
{ {
CELL_CA_Det = AIModel_Base::GetInstance(); CELL_BCA_Det = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config edge_config; AIModel_Base::AIModelRun_Config edge_config;
edge_config.gpuconfig.copy(gupconfig); edge_config.gpuconfig.copy(gupconfig);
edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI/Detect_CA.engine"; edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Detect_BCA.engine";
edge_config.strName = "CA_Det"; edge_config.strName = "BCA_Det";
edge_config.inputType = AIModel_Base::Input_HWC; edge_config.inputType = AIModel_Base::Input_HWC;
edge_config.Stream_num = 2; edge_config.Stream_num = 2;
CELL_CA_Det->Init(edge_config); CELL_BCA_Det->Init(edge_config);
} }
if (!CELL_TA_Det) if (!CELL_BTA_Det)
{ {
CELL_TA_Det = AIModel_Base::GetInstance(); CELL_BTA_Det = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config edge_config; AIModel_Base::AIModelRun_Config edge_config;
edge_config.gpuconfig.copy(gupconfig); edge_config.gpuconfig.copy(gupconfig);
edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI/Detect_TA.engine"; edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Detect_BTA.engine";
edge_config.strName = "TA_Det"; edge_config.strName = "BTA_Det";
edge_config.inputType = AIModel_Base::Input_HWC; edge_config.inputType = AIModel_Base::Input_HWC;
edge_config.Stream_num = 2; edge_config.Stream_num = 2;
CELL_TA_Det->Init(edge_config); CELL_BTA_Det->Init(edge_config);
}
if (!CELL_DCA_Det)
{
CELL_DCA_Det = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config edge_config;
edge_config.gpuconfig.copy(gupconfig);
edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Detect_DCA.engine";
edge_config.strName = "DCA_Det";
edge_config.inputType = AIModel_Base::Input_HWC;
edge_config.Stream_num = 2;
CELL_DCA_Det->Init(edge_config);
}
if (!CELL_DTA_Det)
{
CELL_DTA_Det = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config edge_config;
edge_config.gpuconfig.copy(gupconfig);
edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Detect_DTA.engine";
edge_config.strName = "DTA_Det";
edge_config.inputType = AIModel_Base::Input_HWC;
edge_config.Stream_num = 2;
CELL_DTA_Det->Init(edge_config);
} }
if (!CELL_Align) if (!CELL_Align)
{ {
CELL_Align = AIModel_Base::GetInstance(); CELL_Align = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config edge_config; AIModel_Base::AIModelRun_Config edge_config;
edge_config.gpuconfig.copy(gupconfig); edge_config.gpuconfig.copy(gupconfig);
edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI/Align.engine"; edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Align.engine";
edge_config.strName = "Align"; edge_config.strName = "Align";
edge_config.inputType = AIModel_Base::Input_HWC; edge_config.inputType = AIModel_Base::Input_HWC;
CELL_Align->Init(edge_config); CELL_Align->Init(edge_config);
@ -74,7 +96,7 @@ int AIFactory::InitALLAIModle(GPU_Config gupconfig)
CELL_Mark = AIModel_Base::GetInstance(); CELL_Mark = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config edge_config; AIModel_Base::AIModelRun_Config edge_config;
edge_config.gpuconfig.copy(gupconfig); edge_config.gpuconfig.copy(gupconfig);
edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI/Cell_marker.engine"; edge_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Cell_marker.engine";
edge_config.strName = "Mark"; edge_config.strName = "Mark";
edge_config.inputType = AIModel_Base::Input_HWC; edge_config.inputType = AIModel_Base::Input_HWC;
CELL_Mark->Init(edge_config); CELL_Mark->Init(edge_config);
@ -84,7 +106,7 @@ int AIFactory::InitALLAIModle(GPU_Config gupconfig)
CELL_CA_Cls = AIModel_Base::GetInstance(); CELL_CA_Cls = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config jbl_config; AIModel_Base::AIModelRun_Config jbl_config;
jbl_config.gpuconfig.copy(gupconfig); jbl_config.gpuconfig.copy(gupconfig);
jbl_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI/Class_10.engine"; jbl_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Class_10.engine";
jbl_config.inputType = AIModel_Base::Input_HWC; jbl_config.inputType = AIModel_Base::Input_HWC;
jbl_config.strName = "CA_Class"; jbl_config.strName = "CA_Class";
jbl_config.IsClass = true; jbl_config.IsClass = true;
@ -95,7 +117,7 @@ int AIFactory::InitALLAIModle(GPU_Config gupconfig)
CELL_TA_Cls = AIModel_Base::GetInstance(); CELL_TA_Cls = AIModel_Base::GetInstance();
AIModel_Base::AIModelRun_Config jbl_config; AIModel_Base::AIModelRun_Config jbl_config;
jbl_config.gpuconfig.copy(gupconfig); jbl_config.gpuconfig.copy(gupconfig);
jbl_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI/Class_10_TA.engine"; jbl_config.strPath = "/home/aidlux/BOE/UseModel_CellAOI_CD/Class_10_TA.engine";
jbl_config.inputType = AIModel_Base::Input_HWC; jbl_config.inputType = AIModel_Base::Input_HWC;
jbl_config.strName = "TA_Class"; jbl_config.strName = "TA_Class";
jbl_config.IsClass = true; jbl_config.IsClass = true;

@ -1699,14 +1699,26 @@ int ImgCheckAnalysisy::AI_Detect_Thread(const cv::Mat &img, cv::Mat &ResultImg)
{ {
std::shared_ptr<AIModel_Base> pAIDet; std::shared_ptr<AIModel_Base> pAIDet;
// printf("=====>>>>AI_Detect_Thread m_strCurDetChannel %s \n", m_strCurDetChannel.c_str()); // printf("=====>>>>AI_Detect_Thread m_strCurDetChannel %s \n", m_strCurDetChannel.c_str());
if (m_strCurDetChannel.find("CA") != std::string::npos) if (m_strCurDetChannel.find("BCA") != std::string::npos)
{ {
// printf("=====>>>>AI_Detect_Thread USE CA %s \n", m_strCurDetChannel.c_str()); // printf("=====>>>>AI_Detect_Thread USE CA %s \n", m_strCurDetChannel.c_str());
pAIDet = AI_Factory->CELL_CA_Det; pAIDet = AI_Factory->CELL_BCA_Det;
}
else if (m_strCurDetChannel.find("BTA") != std::string::npos)
{
pAIDet = AI_Factory->CELL_BTA_Det;
}
else if (m_strCurDetChannel.find("DCA") != std::string::npos)
{
pAIDet = AI_Factory->CELL_DCA_Det;
}
else if (m_strCurDetChannel.find("DTA") != std::string::npos)
{
pAIDet = AI_Factory->CELL_DTA_Det;
} }
else else
{ {
pAIDet = AI_Factory->CELL_TA_Det; pAIDet = AI_Factory->CELL_BTA_Det;
} }
std::string strBaseLog = "AI_Detect"; std::string strBaseLog = "AI_Detect";
@ -1870,6 +1882,10 @@ int ImgCheckAnalysisy::Traditional_Detect_Thread(const cv::Mat &img, cv::Mat &Re
return -1; return -1;
} }
if (DetImgInfo_shareP->bsaveProcessImg)
{
cv::imwrite(DetImgInfo_shareP->strChannel + "_AI_mask.png", ResultImg);
}
m_pdetlog->AddCheckstr(PrintLevel_0, DET_LOG_LEVEL_3, strBaseLog, "Traditional_Detect End"); m_pdetlog->AddCheckstr(PrintLevel_0, DET_LOG_LEVEL_3, strBaseLog, "Traditional_Detect End");
return 0; return 0;
} }

Loading…
Cancel
Save