作者分享了挺多的干货:
目录
https://github.com/hpc203/nanodet-plus-opencv
c++版
opencv4.5.4 vs2017测试成功
opencv4.5.5 vs2019测试成功
执行:
把模型文件拷贝到
xxx.vcxproj
同级目录即可。
mat转vector时好像不对,我修改了,用convertMat2Vector
template<typename _Tp>
vector<_Tp> convertMat2Vector(const Mat& mat)
{
return (vector<_Tp>)(mat.reshape(1, 1));//通道数不变,按行转为一行
}
vector<float> v_mat = convertMat2Vector<float>(dst);
for (int a = 0; a < 20; a++) {
cout << v_mat[a] << " ";// ok float
}
cout <&