You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* @Author: your name
* @Date: 2022-04-20 15:49:50
* @LastEditTime: 2022-09-23 21:51:58
* @LastEditors: sueRimn
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /ZCXD_MonitorPlatform/src/CoreLogicModule/include/CamDeal.h
*/
#ifndef SingleGPU_H_
#define SingleGPU_H_
#include <vector>
#include <thread>
#include <mutex>
#include <string>
#include <iostream>
#include <memory>
#include <opencv2/opencv.hpp>
#include "AICheck.h"
using namespace std;
#define MAX_GPU_NUMBER 4
class AI_SingleGPU
{
public:
AI_SingleGPU(int nGpuIdx);
~AI_SingleGPU();
static AI_SingleGPU *GetInstance(int nGpuIdx);
static AI_SingleGPU *m_pInstance[MAX_GPU_NUMBER];
private:
// 定义一个内部类
class CGarbo
{
public:
CGarbo() {};
~CGarbo()
{
for (int i = 0; i < MAX_GPU_NUMBER; i++)
{
if (nullptr != m_pInstance[i])
{
delete m_pInstance[i];
m_pInstance[i] = nullptr;
}
}
}
};
// 定义一个内部类的静态对象
// 当该对象销毁时顺带就释放myInstance指向的堆区资源
static CGarbo m_garbo;
private:
int m_nGpuIdx;
public:
AI_defect AI_defect_NF; // BOE测试
AI_defect AI_defect_Type2; // 第二个检测模型
AI_defect AI_defect_Cls; // 1023
AI_defect AI_defect_Cls_L0; //
AI_defect AI_defect_YX_1; // L0
AI_defect AI_defect_YX_2; // L127 L255
AI_defect AI_defect_zf; // L127 L255
AI_defect AI_defect_UP; // L127 L255
AI_defect AI_defect_Chess; // L127 L255
AI_defect AI_defect_127Cell; // L127 L255
AI_defect AI_defect_RE_POL; // L127 L255
AI_defect AI_defect_RE_AD; // L127 L255
AI_defect AI_defect_Edge_Big; // L127 L255
AI_defect AI_defect_Edge_Samll; // L127 L255
AI_defect AI_defect_LackPol; // 缺pol检测
AI_defect AI_defect_MarkLine; // MarkLine
};
#endif