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=face-effect&type=<type> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
GET /?ci-process=face-effect&type=<type>&detect-url=<detect-url> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
参数名称 | 描述 | 类型 | 是否必选 |
ObjectKey | 对象文件名,例如 folder/document.pdf | String | 必须与参数 detect-url 二选一 |
ci-process | 万象处理能力,人脸特效固定为 face-effect | String | 是 |
detect-url | 您可以通过填写 detect-url 处理任意公网可访问的图片链接。不填写 detect-url 时,后台会默认处理 ObjectKey ,填写了 detect-url 时,后台会处理 detect-url 链接,无需再填写 ObjectKey。 detect-url 示例: http://www.example.com/abc.jpg ,需要进行 UrlEncode,处理后为http%3A%2F%2Fwww.example.com%2Fabc.jpg。 | String | 必须与参数 ObjectKey 二选一 |
type | 人脸特效类型,人脸美颜:face-beautify;人脸性别转换:face-gender-transformation;人脸年龄变化:face-age-transformation;人像分割:face-segmentation | String | 是 |
whitening | type 为 face-beautify 时生效,美白程度,取值范围[0,100]。0不美白,100代表最高程度。默认值30 | Integer | 否 |
smoothing | type 为 face-beautify 时生效,磨皮程度,取值范围[0,100]。0不磨皮,100代表最高程度。默认值10 | Integer | 否 |
faceLifting | type 为 face-beautify 时生效,瘦脸程度,取值范围[0,100]。0不瘦脸,100代表最高程度。默认值70 | Integer | 否 |
eyeEnlarging | type 为 face-beautify 时生效,大眼程度,取值范围[0,100]。0不大眼,100代表最高程度。默认值70 | Integer | 否 |
gender | type 为 face-gender-transformation 时生效,选择转换方向,0:男变女,1:女变男。无默认值。限制:仅对图片中面积最大的人脸进行转换。 | Integer | 否 |
age | type 为 face-age-transformation 时生效,变化到的人脸年龄,取值范围为[10, 80]。无默认值。限制:仅对图片中面积最大的人脸进行转换。 | Integer | 否 |
<Response><ResultImage>base64编码的图片</ResultImage><ResultMask>base64编码的文件</ResultMask></Response>
节点名称(关键字) | 父节点 | 描述 | 类型 |
Response | 无 | 保存结果的容器 | Container |
节点名称(关键字) | 父节点 | 描述 | 类型 |
ResultImage | Response | 处理后的图片 Base64数据 | String |
ResultMask | Response | 人像分割输出参数,一个通过 Base64编码的文件,解码后文件由 Float 型浮点数组成。这些浮点数代表原图从左上角开始的每一行的每一个像素点,每一个浮点数的值是原图相应像素点位于人体轮廓内的置信度(0 - 1)转化的灰度值(0 - 255) | String |
GET /test.jpg?ci-process=face-effect&type=face-beautify&whitening=70&smoothing=80&faceLifting=70&eyeEnlarging=70 HTTP/1.1Authorization:q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=****************************************Host:bucket-1250000000.cos.ap-beijing.myqcloud.com
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 414641Date: Thu, 15 Jun 2017 12:37:29 GMTServer: tencent-imagex-cos-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhfMjc=<Response><ResultImage>base64编码的图片</ResultImage></Response>
文档反馈