@ -6,7 +6,7 @@ data class Config(
/**
* 是否开启GPU加速
*/
var isOpenGPU: Boolean = false,
var isOpenGPU: Boolean = true,
var numThreads: Int = 1,
var context: Context?
)
@ -16,6 +16,10 @@

#### 1.3.1版本优化说明:
模型大小改动较大,原量化模型虽小(6M),但对GPU加速支持不友好,新模型大约26M,完美支持GPU加速并优化识别精度,加速效果明显。建议全部升级该版本。__新版本的GPU加速默认开启状态__,SDK默认会检测设备是否支持,不支持时会自动取消加速(老版本会奔溃)
### 使用
- Add it in your root build.gradle at the end of repositories:
```
@ -28,7 +28,7 @@ class NSFWApplication : MultiDexApplication() {
//初始化鉴黄库NSFW
Classifier.Build()
.context(this) //必须调用 否则会有异常抛出
.isOpenGPU(true)//默认不开启GPU加速 部分机型开启会奔溃,自行选择,默认false
.isOpenGPU(true)//默认不开启GPU加速,默认为true
.numThreads(100) //分配的线程数 根据手机配置设置,默认1
.build()
//全局注入对象