GithubHelp home page GithubHelp logo

pdn1905 / nsfwdetector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lovoo/nsfwdetector

0.0 2.0 0.0 225 KB

A NSFW (aka porn) detector with CoreML

License: BSD 3-Clause "New" or "Revised" License

Swift 93.22% Ruby 6.78%

nsfwdetector's Introduction

NSFWDetector

Version License Platform

NSFWDetector is a small (17 kB) CoreML Model to scan images for nudity. It was trained using CreateML to distinguish between porn/nudity and appropriate pictures. With the main focus on distinguishing between instagram model like pictures and porn.

Usage

guard #available(iOS 12.0, *), let detector = NSFWDetector.shared else {
    return
}

detector.check(image: image, completion: { result in
    switch result {
    case let .success(nsfwConfidence: confidence):
        if confidence > 0.9 {
            // ๐Ÿ˜ฑ๐Ÿ™ˆ๐Ÿ˜
        } else {
            // ยฏ\_(ใƒ„)_/ยฏ
        }
    default:
        break
    }
})

If you want to enforce stricter boundaries for your platform, just apply a lower threshold for the confidence.

Installation

NSFWDetector is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NSFWDetector'

โš ๏ธ Because the model was trained with CreateML, you need Xcode 10 and above to compile the project.

App Size

The Machine Learning Model is only 17 kB in size, so App size won't be affected compared to other libraries using the yahoo model.

Using just the Model

If you don't want to use the Detection Code, you can also just download the MLModel file directly from the latest Release.

Feedback

If you recognize issues with certain kind of pictures, feel free to reach out via Mail or Twitter.

Author

Michael Berg, [email protected]

License

NSFWDetector is available under the BSD license. See the LICENSE file for more info.

nsfwdetector's People

Contributors

absolute-heike avatar sdomula 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.