cmdbug / YOLOv5_NCNN

🍅 Deploy ncnn on mobile phones. Support Android and iOS. 移动端ncnn部署,支持Android与iOS。
GNU General Public License v3.0
1.48k stars 298 forks source link

How to only build the object detection part ? #26

Closed wwdok closed 3 years ago

wwdok commented 3 years ago

The full apk is more than 200MB that is too big for my situation, so what should i do to only build the object detection part (i.e yolov5 yolov4-tiny) with minimal changes in the codes ? Thanks !

cmdbug commented 3 years ago

More than 200 MB contains a lot of model files -> "app/src/main/assets/" yolov4-tiny:ncnn/tools/darknet -> darknet2ncnn.cpp https://github.com/Tencent/ncnn/tree/master/tools/darknet yolov5:There are two ways to achieve, one is to modify the source code. The other is to implement a custom layer, the Focus layer. https://blog.csdn.net/qq_33160678/article/details/108848264?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param === or === https://zhuanlan.zhihu.com/p/275989233?utm_source=qq&utm_medium=social&utm_oi=872955404320141312

cmdbug commented 3 years ago

Opencv is not used in the object detection part, and opencv can also be deleted in the project.

wwdok commented 3 years ago

Thank you for your reply ! i have cut down the apk size.