检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
SDK获取和安装 GO语言SDK的获取和安装使用命令进行安装,参考方法如下: go get -u github.com/huaweicloud/huaweicloud-sdk-go-v3 父主题: 使用SDK(GO)
图1 PyCharm配置python环境 SDK获取和安装 python语言SDK的获取和安装推荐使用pip命令进行安装或使用pycharm进行安装,需要安装huaweicloudsdkcore包以及huaweicloudsdkimage,参考方法如下: pip 安装: # 安装核心库
准备数据 服务不同功能部署的区域,数据格式和调用并发数有相应的约束限制,需要您在使用服务前参考约束准备好待识别的数据。 服务功能的使用约束请参见约束与限制。 例如媒资图像标签,输入数据存在以下约束: 支持“华北-北京四”区域。
2021年8月 序号 功能名称 功能描述 阶段 相关文档 1 新版SDK文档上线 新版SDK可以在GitHub仓库查看SDK更新历史、获取安装包以及查看指导文档,参照进行进阶配置。同时增加了更多开发代码的示例。
为了保持兼容服务端,对此类接口的支持能力,保留该请求参数,但不再展示该参数对应的请求示例和响应示例。 brightness 否 Float 亮度值,亮度值设置的越高,亮度越大。默认值0.9,取值范围[0,1]。 响应消息 图片为BASE64字符串响应参数请参见表2。
Request Body(form-data): file:File(图片文件) gamma:1.5 natural_look:true 方式一:图片文件为BASE64字符串。
成功响应示例 成功时返回图片文件字节流。
exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 执行示例代码文件
exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 执行示例代码文件
connectionException) { Console.WriteLine(connectionException.ErrorMessage); } } } } 执行示例代码文件
exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 执行示例代码文件
connectionException) { Console.WriteLine(connectionException.ErrorMessage); } } } } 执行示例代码文件
e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } 执行示例代码文件
connectionException) { Console.WriteLine(connectionException.ErrorMessage); } } } } 执行示例代码文件
e.getHttpStatusCode()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } 执行示例代码文件
public class RunCelebrityRecognitionSolution { public static void main(String[] args) { // 认证用的ak和sk硬编码到代码中或者明文存储都有很大的安全风险,建议在配置文件或者环境变量中密文存放
exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 执行示例代码文件
connectionException) { Console.WriteLine(connectionException.ErrorMessage); } } } } 执行示例代码文件
"\n"; } 执行示例代码文件,控制台输出媒资图像标签结果即表示程序执行成功。相关参数说明请参考媒资图像标签API。
client.RunImageMediaTagging(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } 执行示例代码文件