22[ ![ ] ( https://jitpack.io/v/devzwy/open_nsfw_android.svg )] ( https://jitpack.io/#devzwy/open_nsfw_android ) [ ![ ] ( https://img.shields.io/badge/Base-TensorFlow-brightgreen.svg )] ( https://github.com/devzwy/open_nsfw_android ) [ ![ ] ( https://img.shields.io/badge/license-Apache%202-green.svg )] ( https://www.apache.org/licenses/LICENSE-2.0 )
33[ ![ ] ( https://img.shields.io/badge/%E4%BD%9C%E8%80%85-赵文贇-orange.svg )] ( https://github.com/devzwy/open_nsfw_android ) [ ![ ] ( https://img.shields.io/badge/QQ-3648415-brightgreen.svg )] ( https://github.com/devzwy/KUtils ) [ ![ ] ( https://img.shields.io/badge/[email protected] )] ( https://github.com/devzwy/open_nsfw_android ) ![ Mozilla Add-on
] ( https://img.shields.io/amo/stars/dustman.svg?label=stars&logo=1&logoColor=1&style=popout ) 44
5- ### 色情图片离线识别,基于TensorFlow实现。识别只需200ms ,可断网测试,成功率99%,调用只要一行代码,从雅虎的开源项目open_nsfw移植,tflite(6M)为训练好的模型(已量化), 该模型文件可用于iOS、java、C++等平台,Python使用生成的tfLite文件检测图片的速度远远快于使用原模型.
5+ ### 色情图片离线识别,基于TensorFlow实现。识别只需20ms ,可断网测试,成功率99%,调用只要一行代码,从雅虎的开源项目open_nsfw移植,该模型文件可用于iOS、java、C++等平台
66### iOS请参考:[ issues13] ( https://github.com/devzwy/open_nsfw_android/issues/13 )
77### Python参考:[ NSFW-Python] ( https://github.com/devzwy/NSFW-Python ) 、[ Python-TensorflowLite-Api] ( https://tensorflow.google.cn/api_docs/python/tf/lite ) 、[ Python-Tensorflow-Api] ( https://tensorflow.google.cn/api_docs/python/tf )
88### Java参考:[ Tensorflow-Api] ( https://tensorflow.google.cn/api_docs/java/reference/org/tensorflow/package-summary )
2020#### 1.3.1版本优化说明:
2121模型大小改动较大,原量化模型虽小(6M),但对GPU加速支持不友好,新模型大约26M,完美支持GPU加速并优化识别精度,加速效果明显。建议全部升级该版本。__ 新版本的GPU加速默认开启状态__ ,SDK默认会检测设备是否支持,不支持时会自动取消加速(老版本会奔溃)
2222
23- ### 使用
24- - Add it in your root build.gradle at the end of repositories:
23+ ### 使用方式一 (建议)
24+ - 添加远程仓库支持
2525```
2626 allprojects {
2727 repositories {
3131 }
3232```
3333
34- - Add the dependency [ ![ ] ( https://jitpack.io/v/devzwy/open_nsfw_android.svg )] ( https://jitpack.io/#devzwy/open_nsfw_android )
34+ - 配置依赖 [ ![ ] ( https://jitpack.io/v/devzwy/open_nsfw_android.svg )] ( https://jitpack.io/#devzwy/open_nsfw_android ) (编译过程报错时请自行使用梯子)
3535
3636```
3737 dependencies {
3838 //versionCode:上面小icon中最新版本号
3939 implementation 'com.github.devzwy:open_nsfw_android:[versionCode]'
4040 }
4141
42+ ```
43+
44+ ### 使用方式二,源码依赖方式
45+ - 克隆源码
46+ ```
47+ git clone 'https://github.com/devzwy/open_nsfw_android.git'
48+ ```
49+
50+ - 项目中依赖lib
51+
52+ ```
53+ dependencies {
54+ implementation project(path: ':OpenNSFW')
55+ }
56+
4257```
4358- 扫描时报如下错误
4459```
@@ -55,13 +70,13 @@ __请添加__
5570```
5671
5772
58- - 使用(请使用最新版本1.3.0 )
73+ - 使用(请使用最新版本1.3.1 )
5974- 建议在Application中全局初始化
6075
6176```
6277 Classifier.Build()
6378 .context(this) //必须调用 否则会有异常抛出
64- // .isOpenGPU(true)//默认不开启GPU加速 部分机型开启会奔溃,自行选择,默认false
79+ // .isOpenGPU(true)//默认不开启GPU加速 ,默认true
6580// .numThreads(10) //分配的线程数 根据手机配置设置,默认1
6681 .build()
6782```
0 commit comments