Practical overview
When it fits
Use it when an iOS app needs a nudity-screening score that can feed into its own upload or moderation decisions.
Who it is for
- iOS developers adding image screening to photo-upload flows
- Teams building moderation steps for social or community apps
- Developers who want a standalone CoreML model rather than the detector wrapper
Documented uses
- Pass an image to a Swift detector and receive an NSFW confidence score.
- Use a configurable threshold as an input to app-level image filtering.
- Add the library through Swift Package Manager or CocoaPods.
- Download the MLModel separately when building around the model rather than the detection code.
Requirements & limits
The project is publicly available under the BSD-3-Clause license. The README documents Swift Package Manager and CocoaPods installation and requires Xcode 10 or later to compile.
- The documented shared-detector usage checks for iOS 12 or later.
- The README provides a 0.9 confidence threshold as an example and says lower thresholds create stricter boundaries.
- The model is described as 17 kB and trained with CreateML, with a stated focus on distinguishing Instagram-model-style images from porn.
- The standalone MLModel can be downloaded from a release, but independent integration details are not given.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Add NSFWDetector to an iOS project
Set up the documented Swift library dependency for an iOS app.
Before you start
- An iOS project using Swift
- Xcode 10 or later to compile the project
Steps
Choose Swift Package Manager or CocoaPods as the dependency manager.
For Swift Package Manager, add the repository URL with the documented .upToNextMajor(from: "1.1.2") requirement.
For CocoaPods, add the dependency as pod 'NSFWDetector'.
Expected outcome
The library dependency is specified in the project; the README does not document further setup or a deployment procedure.
Guide limitations
- This setup guidance does not establish compatibility with a particular project configuration.
- The README checks for iOS 12 or later when accessing the shared detector.
Use the detector’s image confidence in filtering logic
Pass an image to the library and use its returned confidence as a threshold-based input.
Before you start
- NSFWDetector included in an iOS project
- iOS 12 or later for the documented shared-detector usage
Steps
Check availability for iOS 12 or later and obtain NSFWDetector.shared.
Call detector.check(image:completion:) with the image.
Read the nsfwConfidence value from a successful result.
Compare the score with an app-selected threshold; the README shows 0.9 as an example and notes that a lower value applies stricter boundaries.
Expected outcome
The app receives an NSFW confidence score that it can use in its own image-filtering decision.
Guide limitations
- The detector returns a score; the app must supply its own handling logic.
- The README does not describe a complete moderation workflow or independently document the model’s behavior across image types.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- lovoo/NSFWDetector · Official homepage title · retained in its source language

