文档首页> 数字内容生产线 MetaStudio> API参考> 分身形象制作管理> 查询分身数字人模型训练任务列表
更新时间:2024-05-15 GMT+08:00
分享

查询分身数字人模型训练任务列表

功能介绍

该接口用于查询分身数字人模型训练任务列表。

调用方法

请参见如何调用API

URI

GET /v1/{project_id}/digital-human-training-manage/user/jobs

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方法请参考获取项目ID

表2 Query参数

参数

是否必选

参数类型

描述

offset

Integer

偏移量,表示从此偏移量开始查询。

limit

Integer

每页显示的条目数量。

sort_key

String

排序字段,目前只支持create_time。

sort_dir

String

排序方式。

  • asc:升序

  • desc:降序

默认asc升序。

create_until

String

过滤创建时间<=输入时间的记录。

create_since

String

过滤创建时间>=输入时间的记录。

state

String

任务状态,默认所有状态。

可多个状态查询,使用英文逗号分隔。

如state=CREATING,PUBLISHED

query_project_id

String

查询租户id。

batch_name

String

任务批次名称。

tag

String

任务标签。

job_id

String

任务ID。

name

String

分身数字人模型名称

model_resolution

String

模型分辨率

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。使用Token鉴权方式时必选。

通过调用IAM服务获取用户Token接口获取。

响应消息头中X-Subject-Token的值。

Authorization

String

使用AK/SK方式认证时必选,携带的鉴权信息。

X-Sdk-Date

String

使用AK/SK方式认证时必选,请求的发生时间。

格式为(YYYYMMDD'T'HHMMSS'Z')。

X-Project-Id

String

使用AK/SK方式认证时必选,携带项目ID信息。

X-App-UserId

String

第三方用户ID。不允许输入中文。

响应参数

状态码: 200

表4 响应Header参数

参数

参数类型

描述

X-Request-Id

String

请求ID。

表5 响应Body参数

参数

参数类型

描述

count

Integer

分身数字人模型训练任务数量。

jobs

Array of TrainingJobBasicInfo objects

分身数字人模型训练任务列表。

表6 TrainingJobBasicInfo

参数

参数类型

描述

job_id

String

任务ID。

name

String

分身数字人模型名称。该名称会作为资产库中分身数字人模型资产名称。

state

String

任务的状态。

  • WAIT_FILE_UPLOAD:待上传文件

  • AUTO_VERIFYING:自动审核中

  • AUTO_VERIFY_FAILED:自动审核失败

  • MANUAL_VERIFYING:人工审核中

  • MANUAL_VERIFY_FAILED:人工审核失败

  • MANUAL_VERIFY_SUCCESS:审核通过,等待预处理资源

  • TRAINING_DATA_PREPROCESSING:训练数据预处理中

  • TRAINING_DATA_PREPROCESS_FAILED:训练数据预处理失败

  • TRAINING_DATA_PREPROCESS_SUCCESS:训练数据预处理完成,等待训练资源中

  • TRAINING:训练中

  • TRAIN_FAILED:训练失败

  • TRAIN_SUCCESS:训练完成,等待预处理资源

  • INFERENCE_DATA_PREPROCESSING:推理数据预处理中

  • INFERENCE_DATA_PREPROCESS_FAILED:推理数据预处理失败

  • WAIT_MASK_UPLOAD:等待遮罩上传

  • WAIT_MAIN_FILE_UPLOAD:等待主文件上传

  • JOB_SUCCESS:训练任务完成

  • WAIT_USER_CONFIRM:等待用户确认训练效果

  • JOB_REJECT:驳回任务

  • JOB_PENDING:挂起任务

  • JOB_FINISH:任务结束,是最终状态,不支持修改此状态。

asset_id

String

模型资产ID。

project_id

String

模型资产所属项目ID。

cover_download_url

String

分身数字人模型封面下载URL。URL有效期24小时。

last_update_time

String

用户最近一次更新任务的时间(包括租户创建或者重新提交),格式遵循:RFC 3339。 例 “2020-07-30T10:43:17Z”

create_time

String

创建时间,格式遵循:RFC 3339。 例 “2020-07-30T10:43:17Z”

contact

String

分身数字人训练任务创建者联系方式,如手机或邮箱等。

batch_name

String

分身数字人训练任务的批次名称。

tags

Array of strings

分身数字人训练任务标签。

model_version

String

分身数字人模型版本。默认是V3版本模型。

  • V2: V2版本模型

  • V3:V3版本模型

  • V3.2:V3.2版本模型

matting_type

String

抠图类型。默认是AI。

  • AI:AI抠图

  • MANUAL:人工抠图

model_resolution

String

分身数字人模型分辨率。默认是1080P。

  • 1080P:1080P。支持1080P及720P的视频输出。

  • 4K:4K。支持4K、1080P及720P的视频输出。

app_user_id

String

自定义用户id(如创建任务时设置了X-App-UserId则会携带)。

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误描述。

状态码: 500

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误描述。

请求示例

https://aaa.com/rest/v1/***/digital-human-training-manage/user/jobs?query_project_id=***&offset=0&limit=10

响应示例

状态码: 200

处理成功返回。

{
  "count" : 101,
  "jobs" : [ {
    "job_id" : "646682facddb4912976f19a4d61c6a91",
    "name" : "名字1",
    "state" : "TRAINING",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/646682facddb4912976f19a4d61c6a91_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-09T07:38:09Z",
    "create_time" : "2023-12-08T08:30:56Z",
    "contact" : "1**********",
    "tags" : [ ],
    "model_version" : "V3.2",
    "matting_type" : "AI"
  }, {
    "job_id" : "efc5300ecdba4ea48d1ff13a9d907bc0",
    "name" : "名字2",
    "state" : "MANUAL_VERIFYING",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/efc5300ecdba4ea48d1ff13a9d907bc0_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-09T07:32:46Z",
    "create_time" : "2023-12-09T07:31:37Z",
    "contact" : "1**********",
    "model_version" : "V3",
    "matting_type" : "AI"
  }, {
    "job_id" : "7889dfd55bf14834a35e78c7f0aa0516",
    "name" : "名字3",
    "state" : "INFERENCE_DATA_PREPROCESS_FAILED",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/7889dfd55bf14834a35e78c7f0aa0516_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-09T07:09:02Z",
    "create_time" : "2023-12-08T08:34:12Z",
    "contact" : "1**********",
    "tags" : [ ],
    "model_version" : "V3.2",
    "matting_type" : "AI"
  }, {
    "job_id" : "222509ed63c2498599f519d5ec7ef462",
    "name" : "名字4",
    "state" : "TRAINING_DATA_PREPROCESS_SUCCESS",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/222509ed63c2498599f519d5ec7ef462_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-09T07:08:21Z",
    "create_time" : "2023-12-08T08:33:24Z",
    "contact" : "1**********",
    "tags" : [ ],
    "model_version" : "V3.2",
    "matting_type" : "AI"
  }, {
    "job_id" : "dd4a596edc2c44dd881b5e9eff485e21",
    "name" : "名字5",
    "state" : "TRAINING_DATA_PREPROCESS_SUCCESS",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/dd4a596edc2c44dd881b5e9eff485e21_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-09T02:12:01Z",
    "create_time" : "2023-12-08T08:29:25Z",
    "contact" : "1**********",
    "model_version" : "V3.2",
    "matting_type" : "AI"
  }, {
    "job_id" : "bf46c9f335b14e84bd028f6acb52686b",
    "name" : "名字6",
    "state" : "JOB_FINISH",
    "asset_id" : "3174263c6199e0a10d83a257b272ac71",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/bf46c9f335b14e84bd028f6acb52686b_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-08T08:37:39Z",
    "create_time" : "2023-11-29T09:39:25Z",
    "contact" : "1**********",
    "model_version" : "V3",
    "matting_type" : "AI"
  }, {
    "job_id" : "2f96ddd4fdda40af977c1b1d3b6adca8",
    "name" : "名字7",
    "state" : "INFERENCE_DATA_PREPROCESS_FAILED",
    "asset_id" : "22741ee4bc4130282835bdc2a4b4ac79",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/2f96ddd4fdda40af977c1b1d3b6adca8_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-08T07:26:53Z",
    "create_time" : "2023-10-19T01:13:24Z",
    "contact" : "15312090046",
    "batch_name" : "234",
    "model_version" : "V3",
    "matting_type" : "AI"
  }, {
    "job_id" : "e477dcf363234b2f8aa2aad4d8bad46b",
    "name" : "名字8",
    "state" : "INFERENCE_DATA_PREPROCESS_FAILED",
    "asset_id" : "d36e8df774ae88315911724d4467cb6d",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/e477dcf363234b2f8aa2aad4d8bad46b_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-08T01:58:52Z",
    "create_time" : "2023-11-27T06:39:46Z",
    "contact" : "1**********",
    "model_version" : "V3.2",
    "matting_type" : "AI"
  }, {
    "job_id" : "d8ca20175d5b4ae6b0056c62e4553d36",
    "name" : "名字9",
    "state" : "INFERENCE_DATA_PREPROCESS_FAILED",
    "asset_id" : "5ff8e2893ffa8ef848050260eb08faa9",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/d8ca20175d5b4ae6b0056c62e4553d36_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-04T05:39:24Z",
    "create_time" : "2023-11-06T13:51:09Z",
    "contact" : "1**********",
    "model_version" : "V3.2",
    "matting_type" : "AI"
  }, {
    "job_id" : "65e9fb9ac78546268e7d60d5003bfbdc",
    "name" : "名字10",
    "state" : "INFERENCE_DATA_PREPROCESS_FAILED",
    "asset_id" : "71a0df4bd5966a33818af2b5094cf197",
    "project_id" : "***",
    "cover_download_url" : "https://xxx.com/65e9fb9ac78546268e7d60d5003bfbdc_cover?param1=XXX&param2=YYY",
    "last_update_time" : "2023-12-01T07:58:26Z",
    "create_time" : "2023-11-29T11:19:22Z",
    "contact" : "1**********",
    "model_version" : "V3",
    "matting_type" : "AI"
  } ]
}

状态码: 400

{
  "error_code" : "MSS.00000003",
  "error_msg" : "Invalid parameter"
}

状态码: 500

{
  "error_code" : "MSS.00000004",
  "error_msg" : "Internal Error"
}

SDK代码示例

SDK代码示例如下。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion;
import com.huaweicloud.sdk.metastudio.v1.*;
import com.huaweicloud.sdk.metastudio.v1.model.*;


public class List2dModelTrainingJobSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        MetaStudioClient client = MetaStudioClient.newBuilder()
                .withCredential(auth)
                .withRegion(MetaStudioRegion.valueOf("<YOUR REGION>"))
                .build();
        List2dModelTrainingJobRequest request = new List2dModelTrainingJobRequest();
        try {
            List2dModelTrainingJobResponse response = client.list2dModelTrainingJob(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# coding: utf-8

from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkmetastudio.v1.region.metastudio_region import MetaStudioRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkmetastudio.v1 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = __import__('os').getenv("CLOUD_SDK_AK")
    sk = __import__('os').getenv("CLOUD_SDK_SK")
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId) \

    client = MetaStudioClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(MetaStudioRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = List2dModelTrainingJobRequest()
        response = client.list2d_model_training_job(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    metastudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := metastudio.NewMetaStudioClient(
        metastudio.MetaStudioClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.List2dModelTrainingJobRequest{}
	response, err := client.List2dModelTrainingJob(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。

状态码

状态码

描述

200

处理成功返回。

400

请求传参异常,包含错误码及对应描述。

500

内部服务错误。

错误码

请参见错误码

分享:

    相关文档

    相关产品