优化代码

main
熊继淙 1 year ago
parent cd9860ed3c
commit b721eb10fd

@ -14,19 +14,19 @@ public:
// 检查模型输入输出
virtual bool check() = 0;
// 推理
virtual bool doTRTInfer(const std::vector<MN_VisionImage::MS_ImageParam>& _bufImg, std::vector<utils::MR_Result>* _detectRes, int* _user) = 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<utils::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 utils::InitParameter& _params);
MI_ALGORITHM_EXPORT MI_VisionInterface* getInterfacePtr(const trtUtils::InitParameter& _params);

@ -11,33 +11,33 @@ bool __check_cuda_runtime(cudaError_t code, const char* op, const char* file, in
//note: resize rgb with padding
void resizeDevice(const int& batch_size, float* src, int src_width, int src_height,
float* dst, int dstWidth, int dstHeight,
float paddingValue, utils::AffineMat matrix);
float paddingValue, trtUtils::AffineMat matrix);
//overload:resize rgb with padding, but src's type is uin8
void resizeDevice(const int& batch_size, unsigned char* src, int src_width, int src_height,
float* dst, int dstWidth, int dstHeight,
float paddingValue, utils::AffineMat matrix);
float paddingValue, trtUtils::AffineMat matrix);
// overload: resize rgb/gray without padding
void resizeDevice(const int& batchSize, float* src, int srcWidth, int srcHeight,
float* dst, int dstWidth, int dstHeight,
utils::ColorMode mode, utils::AffineMat matrix);
trtUtils::ColorMode mode, trtUtils::AffineMat matrix);
void bgr2rgbDevice(const int& batch_size, float* src, int srcWidth, int srcHeight,
float* dst, int dstWidth, int dstHeight);
void normDevice(const int& batch_size, float* src, int srcWidth, int srcHeight,
float* dst, int dstWidth, int dstHeight,
utils::InitParameter norm_param);
trtUtils::InitParameter norm_param);
void hwc2chwDevice(const int& batch_size, float* src, int srcWidth, int srcHeight,
float* dst, int dstWidth, int dstHeight);
void decodeDevice(utils::InitParameter param, float* src, int srcWidth, int srcHeight, int srcLength, float* dst, int dstWidth, int dstHeight);
void decodeDevice(trtUtils::InitParameter param, float* src, int srcWidth, int srcHeight, int srcLength, float* dst, int dstWidth, int dstHeight);
// nms fast
void nmsDeviceV1(utils::InitParameter param, float* src, int srcWidth, int srcHeight, int srcArea);
void nmsDeviceV1(trtUtils::InitParameter param, float* src, int srcWidth, int srcHeight, int srcArea);
// nms sort
void nmsDeviceV2(utils::InitParameter param, float* src, int srcWidth, int srcHeight, int srcArea,
void nmsDeviceV2(trtUtils::InitParameter param, float* src, int srcWidth, int srcHeight, int srcArea,
int* idx, float* conf);

@ -14,7 +14,7 @@
#endif
namespace utils
namespace trtUtils
{
namespace dataSets
{

Loading…
Cancel
Save