Feature Description
The image quality scoring function uses a synchronous request method. You can detect image files through this interface, evaluate them from multiple aspects, and finally provide a comprehensive and objective clarity score along with a subjective aesthetic score.
Note:
This interface is a GET request, uses synchronous request method, and requires carrying a signature. For specific signature settings, please see Request Signature. Archived storage type and deep archive storage type images on COS do not support processing. If you need to process such images, please first restore archived file. Authorization Description
When used by a sub-account, you need to add ci:CreateAssessQualityJob to the action in the authorization policy. For all operation APIs supported by Cloud Infinite, please see Cloud Infinite action. Service Activation
Using this feature requires enabling Cloud Infinite in advance and binding a bucket. For details, see Bind Bucket. Use Limits
When using this API, please first confirm the relevant restrictions. For details, see Usage Limits. Supported image formats: PNG, JPG, JPEG.
Image size: The downloaded image after Base64 encoding must not exceed 4MB.
Image pixels: It is advisable to be larger than 50*50 pixels; otherwise, it will affect the recognition effect.
Aspect ratio: It is recommended that the ratio of the longer side to the shorter side be less than 5:1.
Fee Description
Request
Request sample
GET /<ObjectKey>?ci-process=AssessQuality HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Request parameters
|
ObjectKey | object filename, for example: folder/document.jpg. | String | Yes |
ci-process | Cloud Infinite processing capability Image quality detection fixed as AssessQuality | String | Yes |
Request header
Request body
The request does not have a request body.
Response
Response Headers
Response Body
The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<LongImage>FALSE</LongImage>
<BlackAndWhite>FALSE</BlackAndWhite>
<SmallImage>FALSE</SmallImage>
<BigImage>TRUE</BigImage>
<PureImage>FALSE</PureImage>
<ClarityScore>89</ClarityScore>
<AestheticScore>70</AestheticScore>
<LowQualityScore>40</LowQualityScore>
<RequestId></RequestId>
</Response>
The data are as follows:
|
Response | None. | Container for saving results. | Container |
The content of Response
|
LongImage | Value is TRUE or FALSE. TRUE indicates a long image, FALSE indicates a normal image. A long image is defined as an image with an aspect ratio greater than or equal to 3 or less than or equal to 1/3. | Boolean |
BlackAndWhite | Value is TRUE or FALSE. TRUE indicates a black and white image, FALSE indicates otherwise. A black and white image, which is a grayscale image, refers to an image where the red, green, and blue channels are displayed in grayscale. It is not a visual "black and white picture." | Boolean |
SmallImage | Value is TRUE or FALSE. TRUE indicates a small image, FALSE indicates otherwise. A small image is defined as an image with a long side less than 179 pixels. When an image is judged as a small image, it is not recommended for recommendation and display. Other fields are uniformly output as 0 or FALSE. | Boolean |
BigImage | Value is TRUE or FALSE. TRUE indicates a large image, FALSE indicates otherwise. Defined as an image with the shortest side greater than 1000 pixels. | Boolean |
PureImage | Value is TRUE or FALSE. TRUE indicates a solid color image or plain text image, i.e., an image with no content or only simple content. FALSE indicates a normal image. | Boolean |
ClarityScore | Image clarity score. A comprehensive evaluation is performed on factors such as noise, exposure, blur, and compression of an image. The value ranges from [0, 100]. The higher the value, the clearer the image. Generally, a value greater than 50 indicates a relatively clear image. The standard can be determined on one's own. | Integer |
AestheticScore | Image aesthetics score. The image is evaluated from multiple artistic dimensions such as composition and color. The value ranges from [0, 100]. The higher the value, the more beautiful the image. Generally, a value greater than 50 indicates a relatively beautiful image. The standard can be determined on one's own. | Integer |
LowQualityScore | Image content quality score. The content quality of an image is evaluated from multiple aspects such as background and image content. The value ranges from [0, 100]. The higher the value, the better the content quality. Generally, a value greater than 50 indicates relatively good content quality. The standard can be determined on one's own. | Integer |
RequestId | Unique request ID, returned for each request. RequestId is required for locating a problem. | String |
Error Codes
This request returns common error responses and error codes. For more information, see Error Codes. Examples
Request
GET /<ObjectKey>?ci-process=AssessQuality HTTP/1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Tue, 03 Apr 2019 09:06:15 GMT
Authorization: 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=**************************************
Response
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 414641
Date: Thu, 15 Jun 2017 12:37:29 GMT
Server: tencent-ci
x-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****
<Response>
<LongImage>FALSE</LongImage>
<BlackAndWhite>FALSE</BlackAndWhite>
<SmallImage>FALSE</SmallImage>
<BigImage>TRUE</BigImage>
<PureImage>FALSE</PureImage>
<ClarityScore>89</ClarityScore>
<AestheticScore>70</AestheticScore>
<LowQualityScore>40</LowQualityScore>
<RequestId>NTk0MjdmODlfMjQ4OGY3XzYzYzhf****</RequestId>
</Response>