NSFW images detection and classification

FREEMIUM
Verified
Por SmartClick | Actualizada il y a 24 jours | Visual Recognition
Popularidad

9.7 / 10

Latencia

1,081ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

how to pass image as an argument?

Rapid account: Rivernate 336
rivernate336
il y a 2 ans

I’m trying pass the path of downloaded image and it’s not working properly, i read the docs and didn’t find any method to do so 😦

Rapid account: Rivernate 336
rivernate336 Commented il y a 2 ans

okay, i’ll wait. Thank you.

Rapid account: Smart Click Support
SmartClickSupport Commented il y a 2 ans

Dear rivernate336, this feature is not added yet. We will inform you as soon as it is added. Thanks for contacting us.

Rapid account: Rivernate 336
rivernate336 Commented il y a 2 ans

getting error: UnicodeEncodeError: ‘latin-1’ codec can’t encode character ‘\u2014’ in position 30: ordinal not in range(256)

Rapid account: Smart Click Support
SmartClickSupport Commented il y a 2 ans

Hi,

You need to read your images as binary and add it as payload if you are trying to upload the images from your computer.

This is an example with python:

Python

import requests
url = “https://{api}.p.rapidapi.com/image-adult-content”

with open(“path/to/file.jpg”, “rb”) as f:
payload = f.read()

headers = {
“X-RapidAPI-Host”: “{api}.p.rapidapi.com”,
“X-RapidAPI-Key”: “xxxxx”,
“content-type”: “multipart/form-data; boundary=—011000010111000001101001”
}

response = requests.request(“POST”, url, data=payload, headers=headers)
print(response.text)

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios