feat 使用单显卡,添加循环测试

dev_lsy
liusiyang 2 weeks ago
parent dcde7fd9e7
commit 456b56e8d4

@ -102,7 +102,7 @@ int main(int argc, char *argv[])
GPU_Config gpu;
gpu.gpu_0 = true;
gpu.gpu_1 = true;
gpu.gpu_1 = false;
AI_Factory->InitALLAIModle(gpu);
std::shared_ptr<AIModel_Base> BOE_Edge_Detect = AI_Factory->BOE_Edge_Detect;

@ -223,7 +223,7 @@ int ALLImgCheckAnalysisy::InitAIFactory()
GPU_Config gpu;
gpu.gpu_0 = true;
gpu.gpu_1 = true;
gpu.gpu_1 = false;
AI_Factory->InitALLAIModle(gpu);
return 0;
@ -466,7 +466,8 @@ int ALLImgCheckAnalysisy::InitData()
int ALLImgCheckAnalysisy::Det_Product(std::shared_ptr<Product> &product)
{
string cur_time_s = CheckUtil::getCurTimeHMS();
printf("[%s]>>>>>>>>>>>>>>>Det_Product****************det Start************\n", cur_time_s.c_str());
// 处理每个相机
while (true)
{
@ -495,8 +496,8 @@ int ALLImgCheckAnalysisy::Det_Product(std::shared_ptr<Product> &product)
// AnalysiyAll(0);
SetProductResult(product);
product->SetCheckEnd();
string cur_time = CheckUtil::getCurTimeHMS();
printf("[%s]>>>>>>>>>>>>>>>Det_Product****************det End************\n", cur_time.c_str());
string cur_time_e = CheckUtil::getCurTimeHMS();
printf("[%s]>>>>>>>>>>>>>>>Det_Product****************det End************\n", cur_time_e.c_str());
return 0;
}

@ -1168,7 +1168,12 @@ int deal::DetImg()
{
m_nReadThread_type = READ_THREAD_TYPE_READIMG;
StartThread(THREAD_RUN_Only_ReadImg);
// -8 循环执行:像 -f 批量一样,线程只启动一次,内部重复跑同一套图
do
{
preCheck();
usleep(10 * 1000);
} while (runConfig.bLoop);
return 0;
}
@ -1598,6 +1603,11 @@ int deal::LoadProductID(std::string strImgPath)
}
int deal::DelImg_Cell_ET()
{
// -8 循环执行:每次重新加载产品列表,重复跑同一批产品
if (runConfig.bLoop && runConfig.filePath != "")
{
LoadProductID(runConfig.filePath);
}
size_t totalSize = m_product_ID_List.size();
if (totalSize > 0)

@ -499,6 +499,7 @@ struct DealRunConfig
RUNTYPE_ det_Type = RUNTYPE_RUN_Pre; // 处理
std::string filePath = ""; // 处理文件路径 如果为空 处理当前的单张图片
bool bSaveProcessImg = false; // 是否中间图片图片
bool bLoop = false; // -8 循环执行(常驻)
void print(std::string str)
{
printf(">>>>>>>>>>>>>>> %s <<<<<<<<<<<<\n", str.c_str());

@ -85,6 +85,7 @@ int main(int argc, char *argv[])
cout << "*** 5、./test_JBL_Check -falign filepath num : 批量测试定位算法num 至多处理张数,结果:/home/aidlux/BOE/Align" << endl;
cout << "*** 6、./test_JBL_Check -rjson filepath: 单张复测filepath xx/xx/3A3K380001B1DK_20240408_152157_Main_0_2_L255" << endl;
cout << "*** 6、./test_JBL_Check -rjsonall filepath: 一套图复测filepath xx/xx/" << endl;
cout << "*** 7、./test_SOCKET -8: 循环执行程序(常驻),不加 -8 只执行一次" << endl;
cout << "******************************************************" << endl;
return 0;
@ -145,12 +146,21 @@ int main(int argc, char *argv[])
test.runConfig.print("config");
// getchar();
signal(SIGINT, handler);
test.start();
while (true)
// -8: 循环执行程序(常驻);默认:执行一次后退出
bool bLoop = false;
for (int i = 1; i < argc; i++)
{
usleep(10 * 1000);
if (string(argv[i]) == "-8")
{
bLoop = true;
break;
}
}
test.runConfig.bLoop = bLoop;
test.start();
return 0;
}

Loading…
Cancel
Save