v20200304

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion = "2020-03-04"

Variables

This section is empty.

Functions

This section is empty.

Types

type AgeInfo

type AgeInfo struct {

	// 变化到的人脸年龄 [10,80]。
	Age *int64 `json:"Age,omitempty" name:"Age"`

	// 人脸框位置。若不输入则选择 Image 或 Url 中面积最大的人脸。
	// 您可以通过 [人脸检测与分析](https://cloud.tencent.com/document/api/867/32800)  接口获取人脸框位置信息。
	FaceRect *FaceRect `json:"FaceRect,omitempty" name:"FaceRect"`
}

type CancelFaceMorphJobRequest

type CancelFaceMorphJobRequest struct {
	*tchttp.BaseRequest

	// 人像渐变任务Job id
	JobId *string `json:"JobId,omitempty" name:"JobId"`
}

func NewCancelFaceMorphJobRequest

func NewCancelFaceMorphJobRequest() (request *CancelFaceMorphJobRequest)

func (*CancelFaceMorphJobRequest) FromJsonString

func (r *CancelFaceMorphJobRequest) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*CancelFaceMorphJobRequest) ToJsonString

func (r *CancelFaceMorphJobRequest) ToJsonString() string

type CancelFaceMorphJobResponse

type CancelFaceMorphJobResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewCancelFaceMorphJobResponse

func NewCancelFaceMorphJobResponse() (response *CancelFaceMorphJobResponse)

func (*CancelFaceMorphJobResponse) FromJsonString

func (r *CancelFaceMorphJobResponse) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*CancelFaceMorphJobResponse) ToJsonString

func (r *CancelFaceMorphJobResponse) ToJsonString() string

type ChangeAgePicRequest

type ChangeAgePicRequest struct {
	*tchttp.BaseRequest

	// 人脸变老变年轻信息。
	// 您可以输入最多3个 AgeInfo 来实现给一张图中的最多3张人脸变老变年轻。
	AgeInfos []*AgeInfo `json:"AgeInfos,omitempty" name:"AgeInfos" list`

	// 图片 base64 数据,base64 编码后大小不可超过5M。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Image *string `json:"Image,omitempty" name:"Image"`

	// 图片的 Url ,对应图片 base64 编码后大小不可超过5M。
	// 图片的 Url、Image必须提供一个,如果都提供,只使用 Url。
	// 图片存储于腾讯云的 Url 可保障更高下载速度和稳定性,建议图片存储于腾讯云。
	// 非腾讯云存储的Url速度和稳定性可能受一定影响。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Url *string `json:"Url,omitempty" name:"Url"`

	// 返回图像方式(base64 或 url ) ,二选一。url有效期为1天。
	RspImgType *string `json:"RspImgType,omitempty" name:"RspImgType"`
}

func NewChangeAgePicRequest

func NewChangeAgePicRequest() (request *ChangeAgePicRequest)

func (*ChangeAgePicRequest) FromJsonString

func (r *ChangeAgePicRequest) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*ChangeAgePicRequest) ToJsonString

func (r *ChangeAgePicRequest) ToJsonString() string

type ChangeAgePicResponse

type ChangeAgePicResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// RspImgType 为 base64 时,返回处理后的图片 base64 数据。默认返回base64
		ResultImage *string `json:"ResultImage,omitempty" name:"ResultImage"`

		// RspImgType 为 url 时,返回处理后的图片 url 数据。
		ResultUrl *string `json:"ResultUrl,omitempty" name:"ResultUrl"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewChangeAgePicResponse

func NewChangeAgePicResponse() (response *ChangeAgePicResponse)

func (*ChangeAgePicResponse) FromJsonString

func (r *ChangeAgePicResponse) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*ChangeAgePicResponse) ToJsonString

func (r *ChangeAgePicResponse) ToJsonString() string

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) CancelFaceMorphJob

func (c *Client) CancelFaceMorphJob(request *CancelFaceMorphJobRequest) (response *CancelFaceMorphJobResponse, err error)

撤销人像渐变任务请求

func (*Client) ChangeAgePic

func (c *Client) ChangeAgePic(request *ChangeAgePicRequest) (response *ChangeAgePicResponse, err error)

用户上传一张人脸图片,基于人脸编辑与生成算法,输出一张人脸变老或变年轻的图片,支持实现人脸不同年龄的变化。

func (*Client) FaceCartoonPic

func (c *Client) FaceCartoonPic(request *FaceCartoonPicRequest) (response *FaceCartoonPicResponse, err error)

输入一张人脸照片,生成个性化的二次元动漫形象,可用于打造个性头像、趣味活动、特效类应用等场景,提升社交娱乐的体验。

func (*Client) MorphFace

func (c *Client) MorphFace(request *MorphFaceRequest) (response *MorphFaceResponse, err error)

输入2-5张人脸照片,生成一段以人脸为焦点的渐变视频或GIF图,支持自定义图片播放速度、视频每秒传输帧数,可用于短视频、表情包、创意H5等应用场景,丰富静态图片的玩法。

func (*Client) QueryFaceMorphJob

func (c *Client) QueryFaceMorphJob(request *QueryFaceMorphJobRequest) (response *QueryFaceMorphJobResponse, err error)

查询人像渐变处理进度

func (*Client) SwapGenderPic

func (c *Client) SwapGenderPic(request *SwapGenderPicRequest) (response *SwapGenderPicResponse, err error)

用户上传一张人脸图片,基于人脸编辑与生成算法,输出一张人脸性别转换的图片。男变女可实现美颜、淡妆、加刘海和长发的效果;女变男可实现加胡须、变短发的效果。

type FaceCartoonPicRequest

type FaceCartoonPicRequest struct {
	*tchttp.BaseRequest

	// 图片 base64 数据,base64 编码后大小不可超过5M。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Image *string `json:"Image,omitempty" name:"Image"`

	// 图片的 Url ,对应图片 base64 编码后大小不可超过5M。
	// 图片的 Url、Image必须提供一个,如果都提供,只使用 Url。
	// 图片存储于腾讯云的 Url 可保障更高下载速度和稳定性,建议图片存储于腾讯云。
	// 非腾讯云存储的Url速度和稳定性可能受一定影响。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Url *string `json:"Url,omitempty" name:"Url"`

	// 返回图像方式(base64 或 url ) ,二选一。url有效期为1天。
	RspImgType *string `json:"RspImgType,omitempty" name:"RspImgType"`

	// 关闭全图动漫化,传入true(不分大小写)即关闭全图动漫化。
	DisableGlobalEffect *string `json:"DisableGlobalEffect,omitempty" name:"DisableGlobalEffect"`
}

func NewFaceCartoonPicRequest

func NewFaceCartoonPicRequest() (request *FaceCartoonPicRequest)

func (*FaceCartoonPicRequest) FromJsonString

func (r *FaceCartoonPicRequest) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*FaceCartoonPicRequest) ToJsonString

func (r *FaceCartoonPicRequest) ToJsonString() string

type FaceCartoonPicResponse

type FaceCartoonPicResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 结果图片Base64信息。
		ResultImage *string `json:"ResultImage,omitempty" name:"ResultImage"`

		// RspImgType 为 url 时,返回处理后的图片 url 数据。(默认为base64)
		ResultUrl *string `json:"ResultUrl,omitempty" name:"ResultUrl"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewFaceCartoonPicResponse

func NewFaceCartoonPicResponse() (response *FaceCartoonPicResponse)

func (*FaceCartoonPicResponse) FromJsonString

func (r *FaceCartoonPicResponse) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*FaceCartoonPicResponse) ToJsonString

func (r *FaceCartoonPicResponse) ToJsonString() string

type FaceMorphOutput

type FaceMorphOutput struct {

	// 人像渐变输出的url
	// 注意:此字段可能返回 null,表示取不到有效值。
	MorphUrl *string `json:"MorphUrl,omitempty" name:"MorphUrl"`

	// 人像渐变输出的结果MD5,用于校验
	// 注意:此字段可能返回 null,表示取不到有效值。
	MorphMd5 *string `json:"MorphMd5,omitempty" name:"MorphMd5"`

	// 人像渐变输出的结果封面图base64字符串
	// 注意:此字段可能返回 null,表示取不到有效值。
	CoverImage *string `json:"CoverImage,omitempty" name:"CoverImage"`
}

type FaceRect

type FaceRect struct {

	// 人脸框左上角纵坐标。
	Y *int64 `json:"Y,omitempty" name:"Y"`

	// 人脸框左上角横坐标。
	X *int64 `json:"X,omitempty" name:"X"`

	// 人脸框宽度。
	Width *int64 `json:"Width,omitempty" name:"Width"`

	// 人脸框高度。
	Height *int64 `json:"Height,omitempty" name:"Height"`
}

type GenderInfo

type GenderInfo struct {

	// 选择转换方向,0:男变女,1:女变男。
	Gender *int64 `json:"Gender,omitempty" name:"Gender"`

	// 人脸框位置。若不输入则选择 Image 或 Url 中面积最大的人脸。
	// 您可以通过 [人脸检测与分析](https://cloud.tencent.com/document/api/867/32800)  接口获取人脸框位置信息。
	FaceRect *FaceRect `json:"FaceRect,omitempty" name:"FaceRect"`
}

type GradientInfo

type GradientInfo struct {

	// 图片的展示时长,即单张图片静止不变的时间。GIF默认每张图片0.7s,视频默认每张图片0.5s。最大取值1s。
	Tempo *float64 `json:"Tempo,omitempty" name:"Tempo"`

	// 人像渐变的最长时间,即单张图片使用渐变特效的时间。 GIF默认值为0.5s,视频默值认为1s。最大取值1s。
	MorphTime *float64 `json:"MorphTime,omitempty" name:"MorphTime"`
}

type MorphFaceRequest

type MorphFaceRequest struct {
	*tchttp.BaseRequest

	// 图片 base64 数据,base64 编码后大小不可超过5M。
	// jpg格式长边像素不可超过4000,其他格式图片长边像素不可超2000。
	// 人员人脸总数量至少2张,不可超过5张。
	// 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Images []*string `json:"Images,omitempty" name:"Images" list`

	// 图片的 Url 。对应图片 base64 编码后大小不可超过5M。jpg格式长边像素不可超过4000,其他格式图片长边像素不可超2000。
	// Url、Image必须提供一个,如果都提供,只使用 Url。图片存储于腾讯云的Url可保障更高下载速度和稳定性,建议图片存储于腾讯云。
	// 非腾讯云存储的Url速度和稳定性可能受一定影响。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	// 人员人脸总数量不可超过5张。
	// 若图片中包含多张人脸,只选取其中人脸面积最大的人脸。
	Urls []*string `json:"Urls,omitempty" name:"Urls" list`

	// 人脸渐变参数。可调整每张图片的展示时长、人像渐变的最长时间
	GradientInfos []*GradientInfo `json:"GradientInfos,omitempty" name:"GradientInfos" list`

	// 视频帧率,取值[1,25]。默认10
	Fps *int64 `json:"Fps,omitempty" name:"Fps"`

	// 视频类型,取值0。目前仅支持MP4格式,默认为MP4格式
	OutputType *int64 `json:"OutputType,omitempty" name:"OutputType"`

	// 视频宽度,取值[128,1280]。默认值720
	OutputWidth *int64 `json:"OutputWidth,omitempty" name:"OutputWidth"`

	// 视频高度,取值[128,1280]。默认值1280
	OutputHeight *int64 `json:"OutputHeight,omitempty" name:"OutputHeight"`
}

func NewMorphFaceRequest

func NewMorphFaceRequest() (request *MorphFaceRequest)

func (*MorphFaceRequest) FromJsonString

func (r *MorphFaceRequest) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*MorphFaceRequest) ToJsonString

func (r *MorphFaceRequest) ToJsonString() string

type MorphFaceResponse

type MorphFaceResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 人像渐变任务的Job id
		JobId *string `json:"JobId,omitempty" name:"JobId"`

		// 预估处理时间,粒度为秒
		EstimatedProcessTime *int64 `json:"EstimatedProcessTime,omitempty" name:"EstimatedProcessTime"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewMorphFaceResponse

func NewMorphFaceResponse() (response *MorphFaceResponse)

func (*MorphFaceResponse) FromJsonString

func (r *MorphFaceResponse) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*MorphFaceResponse) ToJsonString

func (r *MorphFaceResponse) ToJsonString() string

type QueryFaceMorphJobRequest

type QueryFaceMorphJobRequest struct {
	*tchttp.BaseRequest

	// 人像渐变任务Job id
	JobId *string `json:"JobId,omitempty" name:"JobId"`
}

func NewQueryFaceMorphJobRequest

func NewQueryFaceMorphJobRequest() (request *QueryFaceMorphJobRequest)

func (*QueryFaceMorphJobRequest) FromJsonString

func (r *QueryFaceMorphJobRequest) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*QueryFaceMorphJobRequest) ToJsonString

func (r *QueryFaceMorphJobRequest) ToJsonString() string

type QueryFaceMorphJobResponse

type QueryFaceMorphJobResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 当前任务状态:排队中、处理中、处理失败或者处理完成
		JobStatus *string `json:"JobStatus,omitempty" name:"JobStatus"`

		// 人像渐变输出的结果信息
		// 注意:此字段可能返回 null,表示取不到有效值。
		FaceMorphOutput *FaceMorphOutput `json:"FaceMorphOutput,omitempty" name:"FaceMorphOutput"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewQueryFaceMorphJobResponse

func NewQueryFaceMorphJobResponse() (response *QueryFaceMorphJobResponse)

func (*QueryFaceMorphJobResponse) FromJsonString

func (r *QueryFaceMorphJobResponse) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*QueryFaceMorphJobResponse) ToJsonString

func (r *QueryFaceMorphJobResponse) ToJsonString() string

type SwapGenderPicRequest

type SwapGenderPicRequest struct {
	*tchttp.BaseRequest

	// 人脸转化性别信息。
	// 您可以输入最多3个 GenderInfo 来实现给一张图中的最多3张人脸转换性别。
	GenderInfos []*GenderInfo `json:"GenderInfos,omitempty" name:"GenderInfos" list`

	// 图片 base64 数据,base64 编码后大小不可超过5M。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Image *string `json:"Image,omitempty" name:"Image"`

	// 图片的 Url ,对应图片 base64 编码后大小不可超过5M。
	// 图片的 Url、Image必须提供一个,如果都提供,只使用 Url。
	// 图片存储于腾讯云的 Url 可保障更高下载速度和稳定性,建议图片存储于腾讯云。
	// 非腾讯云存储的Url速度和稳定性可能受一定影响。
	// 支持PNG、JPG、JPEG、BMP,不支持 GIF 图片。
	Url *string `json:"Url,omitempty" name:"Url"`

	// 返回图像方式(base64 或 url ) ,二选一。url有效期为1天。
	RspImgType *string `json:"RspImgType,omitempty" name:"RspImgType"`
}

func NewSwapGenderPicRequest

func NewSwapGenderPicRequest() (request *SwapGenderPicRequest)

func (*SwapGenderPicRequest) FromJsonString

func (r *SwapGenderPicRequest) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*SwapGenderPicRequest) ToJsonString

func (r *SwapGenderPicRequest) ToJsonString() string

type SwapGenderPicResponse

type SwapGenderPicResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// RspImgType 为 base64 时,返回处理后的图片 base64 数据。默认返回base64
		ResultImage *string `json:"ResultImage,omitempty" name:"ResultImage"`

		// RspImgType 为 url 时,返回处理后的图片 url 数据。
		ResultUrl *string `json:"ResultUrl,omitempty" name:"ResultUrl"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewSwapGenderPicResponse

func NewSwapGenderPicResponse() (response *SwapGenderPicResponse)

func (*SwapGenderPicResponse) FromJsonString

func (r *SwapGenderPicResponse) FromJsonString(s string) error

It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*SwapGenderPicResponse) ToJsonString

func (r *SwapGenderPicResponse) ToJsonString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL