This repository was archived by the owner on Apr 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
OpenNSFW/src/main/java/com/zwy/opennsfw/core
demo/src/main/java/com/zwy/demo Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ data class Config(
66 /* *
77 * 是否开启GPU加速
88 */
9- var isOpenGPU : Boolean = false ,
9+ var isOpenGPU : Boolean = true ,
1010 var numThreads : Int = 1 ,
1111 var context : Context ?
1212)
Original file line number Diff line number Diff line change 1616
1717![ MVVM] ( https://github.com/devzwy/open_nsfw_android/blob/dev/img/4.jpg )
1818
19+
20+ #### 1.3.1版本优化说明:
21+ 模型大小改动较大,原量化模型虽小(6M),但对GPU加速支持不友好,新模型大约26M,完美支持GPU加速并优化识别精度,加速效果明显。建议全部升级该版本。__ 新版本的GPU加速默认开启状态__ ,SDK默认会检测设备是否支持,不支持时会自动取消加速(老版本会奔溃)
22+
1923### 使用
2024- Add it in your root build.gradle at the end of repositories:
2125```
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class NSFWApplication : MultiDexApplication() {
2828 // 初始化鉴黄库NSFW
2929 Classifier .Build ()
3030 .context(this ) // 必须调用 否则会有异常抛出
31- .isOpenGPU(true )// 默认不开启GPU加速 部分机型开启会奔溃,自行选择,默认false
31+ .isOpenGPU(true )// 默认不开启GPU加速,默认为true
3232 .numThreads(100 ) // 分配的线程数 根据手机配置设置,默认1
3333 .build()
3434 // 全局注入对象
You can’t perform that action at this time.
0 commit comments