麻烦帮忙看下阿里云OpenAPI 客户用我的demo在本地也不能运行,也会报错?我看代码好像没啥问题,他本地也能ping通我们的域名代码:# 场景一:文件在本地img = open(r'D:\stos\stos\media\image\20240506151034.jpg', 'rb')# 场景二:使用任意可访问的url# url = DOMAIN+'/media/image/'+str(file_name)# img = io.BytesIO(urlopen(url).read())segment_head_request = SegmentHeadAdvanceRequest()segment_head_request.image_urlobject = imgruntime = RuntimeOptions()try:# 初始化Clientclient = Client(config)response = client.segment_head_advance(segment_head_request, runtime)# 获取整体结果# print(response.body)response = requests.get(response.body.data.elements[0].image_url,verify=False)if response.status_code == 200:with open(url_name, 'wb') as file:file.write(response.content)file.close()statement = Trueelse:statement = Falseexcept Exception as error:# 获取整体报错信息print(error)statement = False
头像分割:https://help.aliyun.com/zh/viapi/use-cases/image-segmentation-1?spm=a2c4g.11186623.0.i60
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。