NSFW images detection and classification

부분 유료
Verified
분류별 SmartClick | 업데이트됨 22일 전 | Visual Recognition
인기

9.7 / 10

지연 시간

1,062ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

how to pass image as an argument?

Rapid account: Rivernate 336
rivernate336
2년 전

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 2년 전

okay, i’ll wait. Thank you.

Rapid account: Smart Click Support
SmartClickSupport Commented 2년 전

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 2년 전

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 2년 전

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)

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입