![Mozilla Add-on](https://camo.githubusercontent.com/34a5549075e57c35a75bed716c9b14f0395b447d3ec1d4ec59bbf7672d3002a0/68747470733a2f2f696d672e736869656c64732e696f2f616d6f2f73746172732f647573746d616e2e7376673f6c6162656c3d7374617273266c6f676f3d31266c6f676f436f6c6f723d31267374796c653d706f706f7574)
色情图片离线识别,基于TensorFlow实现。识别只需200ms,可断网测试,成功率99%,调用只要一行代码,从雅虎的开源项目open_nsfw_python移植,tflite(6M)为训练好的模型,该模型文件可用于iOS、java、C++等平台
- Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
![](https://camo.githubusercontent.com/473cf5d63a71f56115e6623b0c268d285d189a76c4c515565815e742f928e8ae/68747470733a2f2f6a69747061636b2e696f2f762f6465767a77792f6f70656e5f6e7366775f616e64726f69642e737667)
dependencies {
//versionCode:上面小icon中最新版本号
implementation 'com.github.devzwy:open_nsfw_android:[versionCode]'
}
val nsfwBean = NsfwHelper.getInstance(this, true, 1).scanBitmapSyn(bitmap)
nsfwBean?.sfw ...
nsfwBean?.nsfw ...
- 项目打包时请使用如下代码确定你使用的ndk,否则会打包全部类型的库文件,导致项目异常庞大
ndk {
abiFilters 'armeabi-v7a'
}
![图片](https://github.com/devzwy/open_nsfw_android/raw/master/img/2.png?raw=true)
![图片](https://github.com/devzwy/open_nsfw_android/raw/master/img/1.png?raw=true)