检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
本示例以图像标签为例介绍如何使用Python3调用API。 # encoding:utf-8 import requests import base64 url = "https://{endpoint}/v2/{project_id}/image/tagging" token = "用户获取得到的实际token值"
Threshold = 95, Language = "zh", Url = "https://XXX.jpg" //此处替换为公网可以访问的图片地址 }; try
URISyntaxException, UnsupportedOperationException, IOException { String url = "https://{endpoint}/v2/{project_id}/image/tagging"; String token = "用户获取得到的实际token值";
多项目时,展开“所属区域”,从“项目ID”列获取子项目ID。 调用API获取项目ID 项目ID通过调用查询指定条件下的项目信息API获取。 获取项目ID的接口为GET https://{iam-endpoint}/v3/projects,其中{iam-endpoint}为IAM的终端节点,可以从地区和终端节点处获取。
Threshold = 10, Language = "zh", Url = "https://XXX.jpg" //此处替换为公网可以访问的图片地址 }; try
//image.cn-north-4.myhuaweicloud.com替换为您开通服务区域的终端节点 $endpoint = "https://image.cn-north-4.myhuaweicloud.com"; $projectId = ""; $credentials
RecaptureDetectReq(); body.withThreshold(0f); body.withUrl("https://bucketname.obs.cn-north-4.myhuaweicloud.com/image/test1.jpg"); //替换为公网可以访问的图片地址
//image.cn-north-4.myhuaweicloud.com替换为您开通服务区域的终端节点 $endpoint = "https://image.cn-north-4.myhuaweicloud.com"; $projectId = ""; $credentials
libboost-all-dev libssl-dev libcpprest-dev spdlog 需要从源码进行安装。 git clone https://github.com/gabime/spdlog.git cd spdlog mkdir build cd build cmake
ImageMainObjectDetectionReq(); body.withThreshold(30f); body.withUrl("https://XXX.jpg"); //替换为公网可以访问的图片地址 request.withBody(body);
withThreshold(95f); body.withLanguage("zh"); body.withUrl("https://XXX.jpg"); //此处替换为公网可以访问的图片地址 request.withBody(body);
调用失败时的错误码,具体请参见错误码。 调用成功时无此字段。 error_msg String 调用失败时的错误信息。 调用成功时无此字段。 示例 请求示例 POST https://image.cn-north-1.myhuaweicloud.com/v1.0/bgm/recognition Request
cn-north-4.myhuaweicloud.com替换为您开通服务区域的终端节点,详情请查看地区和终端节点. $endpoint = "https://image.cn-north-4.myhuaweicloud.com"; $projectId = ""; $credentials
或图片信息。 调用接口时,需要您填写图片地址(或利用图片的BASE64编码)。服务会根据您提供的url进行识别功能,例如: POST https://{endpoint}/v2.0/image/tagging { "image" : "", "url" : "XXXX",
ABCDEFJ....”,则调用接口时将“X-Auth-Token: ABCDEFJ....”加到请求消息头即可,如下所示。 GET https://iam.cn-north-1.myhuaweicloud.com/v3/auth/projects Content-Type: application/json
withThreshold(10f); body.withLanguage("zh"); body.withUrl("https://XXX.jpg"); //此处替换为公网可以访问的图片地址 request.withBody(body);
body = RecaptureDetectReq( threshold=0, url="https://bucketname.obs.cn-north-4.myhuaweicloud.com/image/test1.jpg"//替换为公网可以访问的图片地址
thresholdRecaptureDetectReq:= float32(0) urlRecaptureDetectReq:= "https://bucketname.obs.cn-north-4.myhuaweicloud.com/image/test1.jpg"//替换为公网可以访问的图片地址
Explorer,在“代码示例”中选择“Python”。 图3 代码示例 填写请求Body参数: 输入数据可选image或url,本示例使用url,例如https://support.huaweicloud.com/productdesc-image/zh-cn_image_0000001382844041
CelebrityRecognitionReq( threshold=0, url="https://XXX.jpg" //此处替换为公网可以访问的图片地址 ) response = client