You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
910 B
C++
33 lines
910 B
C++
#pragma once
|
|
|
|
#include "utils.h"
|
|
#include "kernel_function.cuh"
|
|
|
|
|
|
class MI_VisionInterface
|
|
{
|
|
public:
|
|
~MI_VisionInterface() = default;
|
|
|
|
// 初始化engine
|
|
virtual bool initEngine(const std::string& _onnxFileName) = 0;
|
|
// 检查模型输入输出
|
|
virtual bool check() = 0;
|
|
// 推理
|
|
virtual bool doTRTInfer(const std::vector<MN_VisionImage::MS_ImageParam>& _bufImg, std::vector<trtUtils::MR_Result>* _detectRes, int* _user) = 0;
|
|
// 推理
|
|
virtual bool doTRTInfer(const std::vector<cv::Mat>& _matImgs, std::vector<trtUtils::MR_Result>* _detectRes, int* _user) = 0;
|
|
// 获取错误信息
|
|
virtual std::string getError() = 0;
|
|
// 释放数据/内存
|
|
virtual void freeMemeory() = 0;
|
|
|
|
// 轴径测量项目接口
|
|
virtual bool measureAxis(std::vector<double>& measureRes, const MN_VisionImage::MS_ImageParam& _bufImg) = 0;
|
|
|
|
};
|
|
|
|
// 导出接口类
|
|
MI_ALGORITHM_EXPORT MI_VisionInterface* getInterfacePtr(const trtUtils::InitParameter& _params);
|
|
|