yolov5的onnx怎么转成ncnn啊,为什么我转出来没有focus层
用netron工具打开param,找到对应focus的部分,修改,如这里所示 https://blog.csdn.net/qq_45057749/article/details/115013509
方案来自 梦想橡皮擦 狂飙组基于 GPT 编写的 “程秘”
转换 YOLOv5 模型到 ncnn 格式可以使用 OpenVINO 转换工具或者其他类似的工具。如果转换后没有 Focus 层,可能是因为 Focus 层不是所有框架都支持的
python yolov5sInfer_ncnn_out.py dog.png
self.net.output_names() ['output', '417', '437']
out_names[0]: -- output
type(ncnn_out) <class 'numpy.ndarray'>
ncnn_out.shape (3, 6400, 85)
printNumpy()
-0.138561487197875977 -0.009932726621627808 -0.258105278015136719 -0.380718827247619629 -12.517526626586914062 -0.669204592704772949 -4.980797290802001953 -3.500458240509033203 -6.847023487091064453 -5.911782741546630859
-6.206901073455810547 -6.214505195617675781 -5.343970298767089844 -4.193430900573730469 -4.471679210662841797 -5.453211784362792969 -4.596863269805908203 -5.232987403869628906 -4.264289379119873047 -3.769028663635253906
out_names[1]: -- 417
type(ncnn_out) <class 'numpy.ndarray'>
ncnn_out.shape (3, 1600, 85)
printNumpy()
-0.974951028823852539 -0.091828197240829468 -0.078549027442932129 -0.824775218963623047 -10.806281089782714844 -1.558434247970581055 -5.618755340576171875 -4.445729255676269531 -5.951706886291503906 -6.004321575164794922
-6.262535095214843750 -6.369493007659912109 -5.844290256500244141 -5.516223430633544922 -4.714602470397949219 -6.453022003173828125 -5.975280284881591797 -6.670634269714355469 -4.930451393127441406 -5.172771453857421875
out_names[2]: -- 437
type(ncnn_out) <class 'numpy.ndarray'>
ncnn_out.shape (3, 400, 85)
printNumpy()
-0.341668695211410522 0.147016882896423340 -0.491063684225082397 -0.354453921318054199 -9.955618858337402344 -1.710951924324035645 -5.311002731323242188 -4.368266105651855469 -5.934424400329589844 -5.750700473785400391
-5.760524749755859375 -5.578440666198730469 -5.427252769470214844 -5.289523124694824219 -5.797097206115722656 -6.159203052520751953 -5.641136169433593750 -6.624048709869384766 -4.286302089691162109 -5.322281360626220703
16 = 0.79546 at 136.28 283.78 177.64 x 440.98
7 = 0.63773 at 467.44 101.13 222.54 x 127.14
2 = 0.45113 at 466.72 99.08 221.51 x 128.81
1 = 0.29964 at 131.10 162.85 453.83 x 552.17