You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jason 7f54e3cfc1 移除采样过程中的水平旋转、移除opencv库,修复:https://github.com/devzwy/open_nsfw_android/issues/4#issuecomment-494745262 6 years ago
.idea 移除采样过程中的水平旋转、移除opencv库,修复:https://github.com/devzwy/open_nsfw_android/issues/4#issuecomment-494745262 6 years ago
app 移除采样过程中的水平旋转、移除opencv库,修复:https://github.com/devzwy/open_nsfw_android/issues/4#issuecomment-494745262 6 years ago
gradle/wrapper first commit. 6 years ago
nsfw 移除采样过程中的水平旋转、移除opencv库,修复:https://github.com/devzwy/open_nsfw_android/issues/4#issuecomment-494745262 6 years ago
.gitignore 去除aar依赖方式,增加远程仓库依赖。 6 years ago
README.md 移除采样过程中的水平旋转、移除opencv库,修复:https://github.com/devzwy/open_nsfw_android/issues/4#issuecomment-494745262 6 years ago
build.gradle 更新demo 6 years ago
gradle.properties first commit. 6 years ago
gradlew first commit. 6 years ago
gradlew.bat first commit. 6 years ago
settings.gradle 移除采样过程中的水平旋转、移除opencv库,修复:https://github.com/devzwy/open_nsfw_android/issues/4#issuecomment-494745262 6 years ago

README.md

open_nsfw_android

Mozilla Add-on

色情图片离线识别,基于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
	dependencies {
	         //versionCode:上面小icon中最新版本号
	        implementation 'com.github.devzwy:open_nsfw_android:[versionCode]'
	}

  • 扫描时报如下错误
java.lang.NullPointerException: Attempt to invoke virtual method 'com.zwy.nsfw.api.NsfwBean com.zwy.nsfw.Classifier.run(android.graphics.Bitmap)' on a null object reference

请添加

  android {
        ...
        aaptOptions {
            noCompress "tflite"
        }
  }
  • Code like this
   val nsfwBean = NsfwHelper.getInstance(this, true, 1).scanBitmapSyn(bitmap)
   nsfwBean?.sfw ...
   nsfwBean?.nsfw ...

点我下载apk

扫码下载

图片

Demo运行结果:

提示:下面的图片不要在公共场所打开!!!

提示:下面的图片不要在公共场所打开!!!

提示:下面的图片不要在公共场所打开!!!

提示:下面的图片不要在公共场所打开!!!

提示:下面的图片不要在公共场所打开!!!

图片