Git Product home page Git Product logo

awesome-archive / open_nsfw_android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devzwy/open_nsfw_android

0.0 2.0 0.0 105.57 MB

色情图片离线识别,基于TensorFlow实现。识别只需200ms,可断网测试,成功率99%,调用只要一行代码,从雅虎的开源项目open_nsfw移植,tflite(6M)为训练好的模型(已量化),该模型文件可用于iOS、java、C++等平台,Python使用生成的tfLite文件检测图片的速度远远小于实用原模型

Java 0.23% Kotlin 99.77%

open_nsfw_android's Introduction

open_nsfw_android

Mozilla Add-on

色情图片离线识别,基于TensorFlow实现。识别只需200ms,可断网测试,成功率99%,调用只要一行代码,从雅虎的开源项目open_nsfw移植,tflite(6M)为训练好的模型(已量化),该模型文件可用于iOS、java、C++等平台,Python使用生成的tfLite文件检测图片的速度远远小于实用原模型.

页面最底部有测试Demo和效果图片,请勿在公共场所打开。

使用

  • 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 nsfwHelper = NSFWHelper.init(NSFWConfig(assets))
  val nsfwBean = nsfwHelper?.scanBitmap(bitmap)!!
  nsfwBean.sfw
  nsfwBean.nsfw
  if(nsfwBean.nsfw>0.3){
    Log.e("NSFW","图片涉黄")
  }

点我下载apk

扫码下载

图片

Demo运行结果:

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

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

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

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

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

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

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

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

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

图片

open_nsfw_android's People

Contributors

devzwy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.