NSFW

The 'NSFW' (Not Safe For Work) model returns probability scores on the likelihood that an image contains nudity. This model is great for anyone trying to automatically moderate or filter offensive content from their platform.

GO TO DOCUMENTATION Updated Apr 24, 2017

Demo

Info

Info

MODEL NAME

NSFW

OWNER

Clarifai

MODEL ID

e9576d86d2004ed1a38ba0cf39ecb4b1

UPDATED AT

Apr 24, 2017

CONCEPTS

NSFW (Not Safe For Work), SFW (Safe For Work)

Request

You can call the Predict API with the 'NSFW' model. Simply pass in an image input with a publicly accessible URL or by directly sending image bytes.

You can learn more about the Predict API in our API Guide.

POST
curl -X POST
    -H 'Authorization: Bearer {access_token}'
    -H "Content-Type: application/json"
    -d '
    {
      "inputs": [
        {
          "data": {
            "image": {
              "url": "https://samples.clarifai.com/nsfw.jpg"
            }
          }
        }
      ]
    }'
    https://api.clarifai.com/v2/models/e9576d86d2004ed1a38ba0cf39ecb4b1/outputs

Response

The Predict API returns probabilities for nsfw (Not Safe For Work) and sfw (Safe For Work) that sum to 1.0. Generally, if the nsfw probability is less than 0.15, it is most likely Safe For Work. If the nsfw probability is greater than 0.85, it is most likely Not Safe For Work.

Response
{
  "status": {
    "code": 10000,
    "description": "Ok"
  },
  "outputs": [
    {
      "id": "dac983354cc04d3e874129aec75a35af",
      "status": {
        "code": 10000,
        "description": "Ok"
      },
      "created_at": "2016-11-22T17:29:18Z",
      "model": {
        "name": "nsfw-v1.0",
        "id": "e9576d86d2004ed1a38ba0cf39ecb4b1",
        "created_at": "2016-09-17T22:18:59Z",
        "app_id": null,
        "output_info": {
          "message": "Show output_info with: GET /models/{model_id}/output_info",
          "type": "concept"
        },
        "model_version": {
          "id": "a6b3a307361c4a00a465e962f721fc58",
          "created_at": "2016-09-17T22:18:59Z",
          "status": {
            "code": 21100,
            "description": "Model trained successfully"
          }
        }
      },
      "input": {
        "id": "dac983354cc04d3e874129aec75a35af",
        "data": {
          "image": {
            "url": "https://samples.clarifai.com/nsfw.jpg"
          }
        }
      },
      "data": {
        "concepts": [
          {
            "id": "ai_RT20lm2Q",
            "name": "sfw",
            "app_id": null,
            "value": 0.93242425
          },
          {
            "id": "ai_KxzHKtPl",
            "name": "nsfw",
            "app_id": null,
            "value": 0.06757575
          }
        ]
      }
    }
  ]
}
SHOW FULL CODE
COMPONENTDESCRIPTION
modelThe model you are using to make predictions on your inputs with. Includes the id, name, created_at date, output info, and information on the model version.
inputThe image data that you passed through the model to make predictions. Includes id and the image data.
dataThe data sent back with the reponse; usually includes the detected concepts and corresponding probability values. (If the model's output type is not concepts, you'll see different output responses here.)

Info

MODEL NAME

NSFW

OWNER

Clarifai

MODEL ID

e9576d86d2004ed1a38ba0cf39ecb4b1

UPDATED AT

Apr 24, 2017

CONCEPTS

NSFW (Not Safe For Work), SFW (Safe For Work)

Get Started for Free with NSFW Model

Start building amazing stuff — no credit card required.

Get Your Free API Key