All Products
Search
Document Center

Platform For AI:AI portrait

Last Updated:Dec 03, 2024

You can use the AI Portrait service of Platform for AI (PAI) to create a custom digital avatar. You need to upload only 5 to 20 images to train a custom digital avatar model. You can call a digital avatar model by using API operations and select templates to generate high-quality AI portraits of different styles.

Feature description

The AI Portrait service involves the following operations:

  1. Image quality check: The system analyzes and evaluates the uploaded images to check whether the images meet the requirements for training.

  2. AI portrait training: You need to upload 5 to 20 images to train a custom digital avatar model.

  3. AI portrait creation: You can call the digital avatar model by using API operations and select templates to generate high-quality AI portraits.

  4. Facial attribute analysis: Optional. A general image analysis service that detects attributes of faces, such as the face orientation, gender, and face shape, by recognizing and analyzing the attributes of face images. For more information, see Multimedia analysis.

image.png

Service type

You can use one of the following methods to implement the AI Portrait service:

Billing

  • Billing of calling API operations of AI Portrait:

    Free quota: PAI provides a free quota for 5 training sessions and 200 service calls. The excess amount is charged based on the official list price.

    The AI Portrait service supports the pay-as-you-go and subscription (resource plan) billing methods. For more information, see Billing.

  • Billing of AI Portrait deployment in EAS:

    For more information about the fees of EAS, see EAS billing.

Use demos

  • For more information, visit GitHub.

If you encounter issues when using the demo, join the official support group for PAI AI Portrait in DingTalk and obtain technical assistance. Group number: 38250008552.

Activate and apply for the AI Portrait service

Activate AI Portrait

Before you can use AI Portrait, you must perform the following steps to activate the service.

  1. Log on to the PAI console.

  2. In the left-side navigation pane, choose Scenario-based Solution > AI Portrait.

  3. On the AI Portrait page, click Activate Now. On the Pay-As-You-Go Model Service page that appears, click Activate Now.

  4. Read and select the Terms of Service check box and click Sign and Purchase.

    After the service is activated, the AI Portrait page appears.

You can purchase resource plans at a discounted price, which is more cost-effective than pay-as-you-go resources. If you do not purchase a resource plan, you are charged on a pay-as-you-go basis based on the number of service calls.

  1. On the AI Portrait page, click Purchase Resource Plan.

  2. On the Subscription Model Service page, configure the parameters based on your business requirements and click Buy Now. Confirm the order and complete the payment by following the on-screen instructions.

Apply for AI Portrait

Join a DingTalk group

Before you call the API operations, add the DingTalk contact tdaj393 displayed on the console or scan the QR code and attach a note AI Portrait Application to join the technical assistance group of the AI Portrait service. Then, you need to send the Terms of Service to the AI Portrait service group to apply for permission. image

SDK usage notes

  • The following figure shows the workflow of API calls.

    image
  • Take note of the following items:

    • The image creation applications are subject to laws and regulations. Alibaba Cloud moderates the images and templates that are imported by using the portrait training and creation operations. The Content Moderation service is used during the process. The content that does not pass the moderation is automatically filtered out. Some content may be mistakenly filtered out.

    • Before you perform model training, we recommend that you call the aigc_images_check operation to check the image quality.

      • You can calculate the number of filtered images by comparing the number of images that you sent with the number of images returned by the aigc_images_check operation. This can help you decide whether to continue training or update the images.

      • If all images are filtered out, an all images are invalid error message is returned. You can call the API operation to perform portrait model training even if only one image is valid.

      • You can check whether valid images have face-related, decoding-related, or other issues in the response of the aigc_images_check operation.

  • The following methods are supported:

  • API SLA

    The response speed of API calls varies based on resources. If you need to ensure the service response speed, contact your account manager or apply for a solution upgrade in the AI Portrait DingTalk Group.

    Operation

    Queries per second (QPS)

    Response speed

    Portrait Training (aigc_images_train)

    2

    10 minutes to 24 hours

    Portrait Training Query (get_async_job)

    20

    1 second

    Solo Portrait Creation (aigc_images_create)

    10

    15 seconds to 5 minutes

    Multi-person Portrait Creation (aigc_images_create_by_multi_model_ids)

    5

    15 × N seconds to 5 × N minutes. N is the number of users.