Automatically Detect Nudity in Images and Video
Use DeepAI's nudity detection API to automatically find NSFW content in image and videos. Filter this content from your online communities without human intervention.
Detects the likelihood that an image contains nudity and should be considered NSFW. Returns a number between 0 and 1, with 1 being 100% likely to contain nudity and be NSFW.
QUICK START API REQUEST
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/nsfw-detector
With a hosted adult content detection API, you can automatically block adult images and adult videos from any application in less than a second.
Detecting nudity in images and videos automatically with ease. This nudity detection API is powered by neural networks that localize objects associated with nudity.
Analyze videos for objects associated with nudity and create your own threshold for what is nudity.
Use DeepAI's nudity detection API to automatically find NSFW content in image and videos. Filter this content from your online communities without human intervention.
Different cultures and industries have their own levels of acceptable nudity or suggestive content. By detecting individual objects associated with nudity and suggestive content, you can filter nudity based on your specific needs.
Nudity Detection cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/nsfw-detector
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/nsfw-detector
Nudity Detection Javascript Examples
// Get the 'deepai' package here (Compatible with browser & nodejs):
// https://www.npmjs.com/package/deepai
// All examples use JS async-await syntax, be sure to call the API inside an async function.
// Learn more about async-await here: https://javascript.info/async-await
// Example posting a image URL:
const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML
deepai.setApiKey('YOUR_API_KEY');
(async function() {
var resp = await deepai.callStandardApi("nsfw-detector", {
image: "YOUR_IMAGE_URL",
});
console.log(resp);
})()
// Example posting file picker input image (Browser only):
const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML
deepai.setApiKey('YOUR_API_KEY');
(async function() {
var resp = await deepai.callStandardApi("nsfw-detector", {
image: document.getElementById('yourFileInputId'),
});
console.log(resp);
})()
// Example posting a local image file (Node.js only):
const fs = require('fs');
const deepai = require('deepai'); // OR include deepai.min.js as a script tag in your HTML
deepai.setApiKey('YOUR_API_KEY');
(async function() {
var resp = await deepai.callStandardApi("nsfw-detector", {
image: fs.createReadStream("/path/to/your/file.jpg"),
});
console.log(resp);
})()
Nudity Detection Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/nsfw-detector",
data={
'image': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/nsfw-detector",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Nudity Detection Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/nsfw-detector', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/nsfw-detector', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
}
)
puts r
Nudity Detection Csharp Examples
// Ensure your DeepAI.Client NuGet package is up to date: https://www.nuget.org/packages/DeepAI.Client
// Example posting a image URL:
using DeepAI; // Add this line to the top of your file
DeepAI_API api = new DeepAI_API(apiKey: "YOUR_API_KEY");
StandardApiResponse resp = api.callStandardApi("nsfw-detector", new {
image = "YOUR_IMAGE_URL",
});
Console.Write(api.objectAsJsonString(resp));
// Example posting a local image file:
using DeepAI; // Add this line to the top of your file
DeepAI_API api = new DeepAI_API(apiKey: "YOUR_API_KEY");
StandardApiResponse resp = api.callStandardApi("nsfw-detector", new {
image = File.OpenRead("C:\\path\\to\\your\\file.jpg"),
});
Console.Write(api.objectAsJsonString(resp));