History
Introduction
API Category
Making API Requests
Region APIs
Instance APIs
Cloud Hosting Cluster APIs
Image APIs
Instance Launch Template APIs
Placement Group APIs
Key APIs
Security Group APIs
Network APIs
Data Types
Error Codes
GET /<ObjectKey>?ci-process=detect-label&scenes=<scenes> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
GET /?ci-process=detect-label&scenes=<scenes>&detect-url=<detect-url> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
参数名称 | 描述 | 类型 | 是否必选 |
ObjectKey | 对象文件名,例如 picture.jpg | string | 否 |
ci-process | 固定值 detect-label | string | 是 |
scenes | 本次调用支持的识别场景,可选值如下: web,针对网络图片优化 camera,针对手机摄像头拍摄图片优化 album,针对手机相册、网盘产品优化 news,针对新闻、资讯、广电等行业优化 如果不传此参数,则默认为 camera 支持多场景(scenes)一起检测,以 ,分隔。例如,使用 scenes = web,camera 即对一张图片使用两个模型同时检测,输出两套识别结果 | String | 否 |
detect-url | 您可以通过填写 detect-url 处理任意公网可访问的图片链接。不填写 detect-url 时,后台会默认处理 ObjectKey ,填写了 detect-url 时,后台会处理 detect-url 链接,无需再填写 ObjectKey detect-url 示例: http://www.example.com/abc.jpg ,需要进行 UrlEncode,处理后为http%25253A%25252F%25252Fwww.example.com%25252Fabc.jpg | String | 否 |
参数名称 | 描述 | 类型 |
RecognitionResult | 图片标签识别结果 | Container |
参数名称 | 描述 | 类型 |
AlbumLabels | Album 相册版标签结果数组。 如未选择 album 场景,则不存在该项。此字段可能为空,表示取不到有效值 | Container |
CameraLabels | Camera 摄像头版标签结果数组。 如未选择 camera 场景,则不存在该项。此字段可能为空,表示取不到有效值 | Container |
NewsLabels | News 新闻版标签结果数组。 如未选择 news 场景,则不存在该项。此字段可能为空,表示取不到有效值 | Container |
WebLabels | Web 网络版标签结果数组。 如未选择 web 场景,则不存在该项。此字段可能为空,表示取不到有效值 | Container |
参数名称 | 描述 | 类型 |
Labels | 标签信息 | Container |
参数名称 | 描述 | 类型 |
Confidence | 该标签的置信度分数,分数越高则该标签准确度越高 | Int |
FirstCategory | 标签的一级分类 | String |
Name | 识别出的图片标签 | String |
SecondCategory | 标签的二级分类 | String |
GET /picture.jpg?ci-process=detect-label&scenes=web,camera,album,news HTTP/1.1Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.comDate: Tue, 03 Apr 2019 09:06:15 GMTAuthorization: <Auth String>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 645Date: Tue, 03 Apr 2018 09:06:16 GMTStatus: 200 OKx-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****<RecognitionResult><AlbumLabels><Labels><Confidence>72</Confidence><FirstCategory>动植物</FirstCategory><Name>鹿</Name><SecondCategory>哺乳动物</SecondCategory></Labels></AlbumLabels><CameraLabels><Labels><Confidence>26</Confidence><FirstCategory>动植物</FirstCategory><Name>羚羊</Name><SecondCategory>哺乳动物</SecondCategory></Labels><Labels><Confidence>21</Confidence><FirstCategory>动植物</FirstCategory><Name>兔子</Name><SecondCategory>哺乳动物</SecondCategory></Labels><Labels><Confidence>18</Confidence><FirstCategory>动植物</FirstCategory><Name>鹿</Name><SecondCategory>哺乳动物</SecondCategory></Labels><Labels><Confidence>10</Confidence><FirstCategory>动植物</FirstCategory><Name>狮子</Name><SecondCategory>哺乳动物</SecondCategory></Labels><Labels><Confidence>5</Confidence><FirstCategory>动植物</FirstCategory><Name>豹</Name><SecondCategory>哺乳动物</SecondCategory></Labels></CameraLabels><NewsLabels><Labels><Confidence>60</Confidence><FirstCategory>植物及其他生物</FirstCategory><Name>植物</Name><SecondCategory>植物类别</SecondCategory></Labels><Labels><Confidence>38</Confidence><FirstCategory>植物</FirstCategory><Name>树</Name><SecondCategory>树</SecondCategory></Labels></NewsLabels><WebLabels><Labels><Confidence>97</Confidence><FirstCategory>动植物</FirstCategory><Name>野生动物</Name><SecondCategory>其他</SecondCategory></Labels><Labels><Confidence>82</Confidence><FirstCategory>动植物</FirstCategory><Name>哺乳动物</Name><SecondCategory>哺乳动物</SecondCategory></Labels><Labels><Confidence>78</Confidence><FirstCategory>动植物</FirstCategory><Name>动物</Name><SecondCategory>其他</SecondCategory></Labels><Labels><Confidence>71</Confidence><FirstCategory>动植物</FirstCategory><Name>鹿</Name><SecondCategory>哺乳动物</SecondCategory></Labels><Labels><Confidence>41</Confidence><FirstCategory>动植物</FirstCategory><Name>白尾鹿</Name><SecondCategory>哺乳动物</SecondCategory></Labels></WebLabels></RecognitionResult>
文档反馈