Modifies image samples

Last updated: 2021-02-01 11:48:18

1. API Description

Domain name for API request: mps.tencentcloudapi.com.

This API is used to modify image samples by image ID. You can use it to modify the name and description of an image sample and add/delete/reset facial features or tags. There must be at least one image left after the deletion of facial features; otherwise, please reset instead of delete the facial features.

A maximum of 100 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: ModifyPersonSample.
Version Yes String Common parameter. The value used for this API: 2019-06-12.
Region No String Common parameter. This parameter is not required for this API.
PersonId Yes String Image ID
Name No String Name. Length limit: 128 characters.
Description No String Description. Length limit: 1,024 characters.
Usages.N No Array of String Image usage. Valid values:
1. Recognition: used for content recognition; equivalent to Recognition.Face
2. Review: used for inappropriate information recognition; equivalent to Review.Face
3. All: used for content recognition and inappropriate information recognition; equivalent to 1+2
FaceOperationInfo No AiSampleFaceOperation Information of operations on facial features
TagOperationInfo No AiSampleTagOperation Tag operation information.

3. Output Parameters

Parameter Name Type Description
Person AiSamplePerson Image information
FailFaceInfoSet Array of AiSampleFailFaceInfo Information of images that failed the verification by facial feature positioning.
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Modifying image samples

This example shows you how to modify the name and description of an image.

Input Example

https://mps.tencentcloudapi.com/?Action=ModifyPersonSample
&PersonId=10569
&Name=John Smith
&Description=American actor, director, and producer
&Usages.0=All
&<Common request parameters>

Output Example

{
  "Response": {
    "Person": {
      "PersonId": "10569",
      "Name": "John Smith",
      "Description": "American actor, director, and producer",
      "FaceInfoSet": [
        {
          "FaceId": "10023",
          "Url": "http://1256768367.vod2.myqcloud.com/8b0dd2b5vodcq1256768367/001ac0735285890783753281553/face.jpeg"
        }
      ],
      "TagSet": [],
      "Usages": [
        "Recognition.Face",
        "Review.Face"
      ],
      "CreateTime": "2018-10-01T10:00:00Z",
      "UpdateTime": "2018-10-01T10:00:00Z"
    },
    "FailFaceInfoSet": null,
    "RequestId": "33737bdf-e2ed-4eda-b09b-f3782d8a9710"
  }
}

Example2 Modifying an image sample - add

This example shows you how to add a facial feature image and image tag.

Input Example

https://mps.tencentcloudapi.com/?Action=ModifyPersonSample
&PersonId=10569
&Name=John Smith
&Description=American actor, director, and producer
&FaceOperationInfo.Type=add
&FaceOperationInfo.FaceContents.0=/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCACgARgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0t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