gpt4 book ai didi

python - 使用sightengine api 时,“检查​​”对象没有属性 'image'

转载 作者:行者123 更新时间:2023-12-01 02:27:24 25 4
gpt4 key购买 nike

我正在使用sightengine API 来检测图像中的 child 性虐待。为了做到这一点,我尝试使用sightengine API 检测图像中的裸体级别。文档本身提供了以下示例。

from sightengine.client import SightengineClient

client = SightengineClient('api_user', 'api_key')
output = client.check('nudity').image('https://d3m9459r9kwism.cloudfront.net/img/examples/example7.jpg')

除了复制相同的代码之外,我还收到以下错误。

Traceback (most recent call last):
File "driver.py", line 3, in <module>
output = client.check('nudity').image('https://d3m9459r9kwism.cloudfront.net/img/examples/example7.jpg')
AttributeError: 'Check' object has no attribute 'image'

我对相同的代码使用了 Python 2 和 Python 3,但都引发了相同的错误。

最佳答案

试试这个:

from sightengine.client import SightengineClient

client = SightengineClient('API user', 'API secret')

checkNudity = client.check('nudity')

output1 = checkNudity.set_url('https://d3m9459r9kwism.cloudfront.net/img/examples/example7.jpg')

print(output1)

关于python - 使用sightengine api 时,“检查​​”对象没有属性 'image',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47239874/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com