cmdbug / TNN_Demo

🍉 移动端TNN部署学习笔记,支持Android与iOS。
GNU General Public License v3.0
69 stars 18 forks source link

where is the code of run the yolo5's tnn model and get the bbox ? #11

Closed henbucuoshanghai closed 3 years ago

cmdbug commented 3 years ago

Android: https://github.com/cmdbug/TNN_Demo/blob/main/android_TNN_Demo/app/src/main/cpp/Yolov5.cpp iOS: https://github.com/cmdbug/TNN_Demo/blob/main/iOS_TNN_Demo/TNNDemo/Yolov5.mm

henbucuoshanghai commented 3 years ago

opencv is cv2.imread  one image,how about the code in yolov5.mm?

TNN_NS::MatConvertParam,,,  how to read one image??

/ 转换大小 TNN_NS::ResizeParam param; param.type = TNN_NS::InterpType::INTERP_TYPE_NEAREST; status = TNN_NS::MatUtils::Resize(input_mat, resize_mat, param, command_queue);

// 输入数据
TNN_NS::MatConvertParam input_cvt_param;
input_cvt_param.scale = {1.0 / 255, 1.0 / 255, 1.0 / 255, 0.0};
input_cvt_param.bias = {0.0, 0.0, 0.0, 0.0};
status = YoloV5::instance->SetInputMat(resize_mat, input_cvt_param);
cmdbug commented 3 years ago

For the data pointer of the incoming picture, you can also see the example of the official demo.

henbucuoshanghai commented 3 years ago

你好   你的nanodet跑通了,模型代码用你的  感谢 很厉害 但是自己训练了一个只一类的nanodet  用官方的export导出后tnn  更换掉类别后代码报错 请问怎么回事??感激!!