YOLOv5_NCNN icon indicating copy to clipboard operation
YOLOv5_NCNN copied to clipboard

platform.h and vulkan.h not found(安卓与iOS vulkan集成的大概版本信息与配置)

Open alex-imperfect opened this issue 4 years ago • 9 comments

I need some help getting this to work please. As adviced, I downloaded ncnn.framework and opencv2.framework and replaced the files.

Unfortunately I am still getting errors: Xcode_errors

Do I need to download any other files to make it work? Help would be much appreciated.

alex-imperfect avatar Dec 23 '20 05:12 alex-imperfect

You can try the 20201208 version. The 20201218 version has not been tried, and the structure of the new version has changed. The library used by the iOS project does not include vulkan and bitcode image

cmdbug avatar Dec 23 '20 06:12 cmdbug

Thank you for the response. Is there also a recommended version of opencv2?

I downloaded opencv2.framework from opencv.org but get a few errors with that now:

Semantic Issue opencv2.framework/Headers/flann/any.h:60:63: Use of typeid requires -frtti opencv2.framework/Headers/flann/any.h:276:31: Use of typeid requires -frtti opencv2.framework/Headers/flann/any.h:285:31: Use of typeid requires -frtti opencv2.framework/Headers/flann/any.h:293:34: Use of typeid requires -frtti opencv2.framework/Headers/flann/any.h:313:34: Use of typeid requires -frtti

Parse Issue opencv2.framework/Headers/stitching/detail/exposure_compensate.hpp:66:12: Expected identifier opencv2.framework/Headers/stitching/detail/seam_finders.hpp:62:12: Expected identifier opencv2.framework/Headers/stitching/detail/blenders.hpp:68:12: Expected identifier

alex-imperfect avatar Dec 23 '20 07:12 alex-imperfect

Try: Build Settings >>> Apple Clang - Language - C++ >>> Enable C++ Runtime Types >>> NO

If not, you may need to compile ncnn. Because the default configuration of ncnn conflicts with opencv. To compile ncnn, you only need to add these two parameters: -DNCNN_DISABLE_RTTI=OFF -DNCNN_DISABLE_EXCEPTION=OFF

Or send you the opencv that I use.

cmdbug avatar Dec 23 '20 07:12 cmdbug

Forgot where opencv came from. But the version number is 2.4.13 image

cmdbug avatar Dec 23 '20 07:12 cmdbug

Try: Build Settings >>> Apple Clang - Language - C++ >>> Enable C++ Runtime Types >>> NO

If not, you may need to compile ncnn. Because the default configuration of ncnn conflicts with opencv. To compile ncnn, you only need to add these two parameters: -DNCNN_DISABLE_RTTI=OFF -DNCNN_DISABLE_EXCEPTION=OFF

Or send you the opencv that I use.

If these two parameters are turned on, GPU acceleration cannot be used, image

matt45m avatar Dec 23 '20 17:12 matt45m

To run the GPU, you need to use the vulkan library.

cmdbug avatar Dec 23 '20 23:12 cmdbug

https://github.com/Tencent/ncnn/wiki/FAQ-ncnn-vulkan#how-to-use-ncnn-vulkan-on-ios

cmdbug avatar Dec 24 '20 00:12 cmdbug

iOS recommends using cpu library, iOS GPU optimization is not good. image

cmdbug avatar Dec 24 '20 01:12 cmdbug

Thank you so much, it works now!

In summary:

iOS:

  • Download the required files from https://github.com/Tencent/ncnn using the 20201208 version.

image

  • Download opencv2.framework from version 2.4.13: https://github.com/opencv/opencv/releases/tag/2.4.13

Android:

Install the correct version of NDK. In Android Studio:

  • Preferences
  • Appearance & Behavior
  • System Settings
  • Android SDK
  • SDK Tools
  • Show Package Details to see all versions
  • NDK: Tick 21.0.6113669.

alex-imperfect avatar Jan 04 '21 21:01 alex-imperfect