{"id":18280237,"url":"https://github.com/mlbo/insightface-npu","last_synced_at":"2025-04-05T06:30:23.828Z","repository":{"id":47780575,"uuid":"395500368","full_name":"mlbo/Insightface-NPU","owner":"mlbo","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-27T05:45:55.000Z","size":46478,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T22:52:55.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-13T02:38:28.000Z","updated_at":"2025-01-11T16:13:35.000Z","dependencies_parsed_at":"2022-09-23T20:01:34.074Z","dependency_job_id":null,"html_url":"https://github.com/mlbo/Insightface-NPU","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlbo%2FInsightface-NPU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlbo%2FInsightface-NPU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlbo%2FInsightface-NPU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlbo%2FInsightface-NPU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlbo","download_url":"https://codeload.github.com/mlbo/Insightface-NPU/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299766,"owners_count":20916183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T12:33:54.238Z","updated_at":"2025-04-05T06:30:18.818Z","avatar_url":"https://github.com/mlbo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Insightface Android NPU\n\n## [app/src/main](https://github.com/mlbo/Insightface-NPU/tree/master/app/src/main)目录结构\n\n```\n├─assets                                存放模型\n├─java                                  Java代码\n├─jni                                   C++代码\n│  ├─algorithm                          SCRFD代码\n│  ├─include                            \n│  │  └─image                           图像处理代码\n│  ├─opencv-mobile-3.4.15-android       OpenCV mobile     \n│  │  \n│  └─utility                            SCRFD涉及处理代码\n├─jniLibs\n│  ├─arm64-v8a                          64位Tengine Android动态库\n│  └─armeabi-v7a                        32位支持TIM-VX的Tengine Android动态库\n```\n\n\n## 准备\n0. Khadas VIM3开发板一套\n1. 用 Android Studio 建立一个空白Android项目\n2. 把按照[交叉编译 Arm32/64 Android 版本](https://github.com/OAID/Tengine/blob/tengine-lite/doc/compile.md#3-%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91-arm3264-android-%E7%89%88%E6%9C%AC)和[编译 Android 32bit 平台](https://github.com/OAID/Tengine/blob/tengine-lite/doc/npu_tim-vx_user_manual_zh.md#29-%E7%BC%96%E8%AF%91-android-32bit-%E5%B9%B3%E5%8F%B0)\n教程编译好的so分别复制到Android项目中jniLibs目录中arm64-v8a和armeabi-v7a文件夹内\n3. 把[SCRFD模型](#)模型复制到Android项目中assets目录\n4. 把[Tengine/demos/](https://github.com/OAID/Tengine/tree/tengine-lite/demos0)中的SCRFD涉及的代码复制到Android项目中的jni目录\n\n## 编译环境搭建\n\n参考[Insightface-NPU/app/build.gradle](https://github.com/mlbo/Insightface-NPU/blob/master/app/build.gradle)\n### Android SDK\n```\n  minSdkVersion 24\n  targetSdkVersion 30\n```\n\n### Android NDK\n\n```\n  ndk {\n      moduleName \"tengine-lite\"\n      abiFilters \"armeabi-v7a\",'arm64-v8a'\n      ndkVersion \"21.4.7075529\"\n  }\n```\n\n\n### Android OpenCV\n\n下载[opencv-mobile-3.4.15-android.zip](https://github.com/nihui/opencv-mobile/releases/download/v13/opencv-mobile-3.4.15-android.zip)，然后解压放入jni目录\n\n## TODO\n- [ ] 针对Android手机性能优化\n\n\n## 参考\n\n1. [Tengine](https://github.com/OAID/Tengine)\n2. [ncnn](https://github.com/Tencent/ncnn)\n3. [opencv-mobile](https://github.com/nihui/opencv-mobile)\n4. [ncnn-android-nanodet](https://github.com/nihui/ncnn-android-nanodet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlbo%2Finsightface-npu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlbo%2Finsightface-npu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlbo%2Finsightface-npu/lists"}