Version 35660
The service returns the nudity probability in the uploaded image from 0 to 1. It can be used to filter inappropriate content.
Supported image formats are:
/api/v1/detection
Compute the nudity probability in the uploaded image from 0 to 1.
POST https://api.example.com/api/v1/conversions
Content-Type: multipart/form-data
Parameter | Type | Presence | Description |
---|---|---|---|
file | File | Required | Image |
Examples:
curl -F file=@/some/image/on/your/local/disk http://nudity.service/api/v1/detection
<?php
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'http://nudity.service.srw.cz',
'timeout' => 5.0,
]);
$response = $client->request('POST', '/api/v1/detection', [
'multipart' => [
[
'name' => 'file',
'contents' => fopen('/some/image/on/your/local/disk', 'r')
],
]
]);
$body = $response->getBody();
$json = json_decode((string) $body->getContents());
Content-Type: application/json
Probability value.
Example:
{"score": 0.0042}
Content-Type: application/json
Parameter | Description |
---|---|
error | Error description. |
Example:
{"error": "File is not a valid image."}
Upload image and show the result.
On the image is nudity with probability %
Error: