"NSFWImage" (Built-in Classifier)
"NSFWImage" (Built-in Classifier)
Determine whether an image is considered not safe for work.
Classes
Details
- This classifier is based on the net model Yahoo Open NSFW Model V1.
- This classifier may download resources that will be stored in your local object store at $LocalBase, and that can be listed using LocalObjects[] and removed using ResourceRemove.
Examples
open all close allBasic Examples (2)
Determine whether the input image contains pornographic contents (not safe):
Classify["NSFWImage", [image]]Obtain the probabilities for different classes:
Classify["NSFWImage", [image], "Probabilities"]Obtain a ClassifierFunction for this classifier:
c = Classify["NSFWImage"]Use the classifier function to classify an example:
c[[image]]Classify many examples at once:
c[{[image], [image]}]Scope (1)
Load the ClassifierFunction corresponding to the built-in classifier:
c = Classify["NSFWImage"]Information[c, "Classes"]Options (2)
ClassPriors (1)
Use a custom ClassPriors for the possible outputs:
Classify["NSFWImage", [image], ClassPriors -> <|"Safe" -> 0.5, "Not Safe" -> 0.5|>]IndeterminateThreshold (1)
Use a custom IndeterminateThreshold:
Classify["NSFWImage", [image], IndeterminateThreshold -> 0.99]Related Guides
History
Introduced in 2018 (11.3)