Popularity
7.8
Stable
Activity
0.0
Declining
1,554
49
104

Programming language: Swift
License: BSD 3-clause "New" or "Revised" License
Tags: Media     Media Processing    
Latest version: v1.1.0

NSFWDetector alternatives and similar libraries

Based on the "Media Processing" category.
Alternatively, view NSFWDetector alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of NSFWDetector or a related project?

Add another 'Media Processing' Library

README

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.


*Note that all licence references and agreements mentioned in the NSFWDetector README section above are relevant to that project's source code only.