Contents

SCSensitivityAnalyzer

An object that analyzes media for sensitive content.

Declaration

class SCSensitivityAnalyzer

Mentioned in

Overview

To check an image for nudity, call one of this class’s analyzeImage methods and pass in a user-provided image, or a URL to the image.

// Analyze an image file at a particular URL.
let response = try await analyzer.analyzeImage(at: url)

To analyze a video file, pass a URL to a video on disk into videoAnalysis(forFileAt:) and wait for the hasSensitiveContent() method to complete.

let handler = analyzer.videoAnalysis(forFileAt: videoFileUrl)
let response = try await handler.hasSensitiveContent()

This class successfully detects nudity only when analysisPolicy is a value other than SCSensitivityAnalysisPolicy.disabled.

Topics

Creating a sensitivity analyzer

Determining a nudity detection strategy

Analyzing images

Analyzing video

See Also

Image and video file analysis