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

dev_lsy
liusiyang 2 weeks ago
parent d355c530c2
commit 5a79d82d9e

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

@ -237,7 +237,7 @@ int ALLImgCheckAnalysisy::InitAIFactory()
GPU_Config gpu; GPU_Config gpu;
gpu.gpu_0 = true; gpu.gpu_0 = true;
gpu.gpu_1 = true; gpu.gpu_1 = false;
AI_Factory->InitALLAIModle(gpu); AI_Factory->InitALLAIModle(gpu);
return 0; return 0;

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

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

@ -145,12 +145,21 @@ int main(int argc, char *argv[])
test.runConfig.print("config"); test.runConfig.print("config");
// getchar(); // getchar();
signal(SIGINT, handler); 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; return 0;
} }

Loading…
Cancel
Save