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 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
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
func (*ChangeAgePicResponse) ToJsonString ¶
func (r *ChangeAgePicResponse) ToJsonString() string
type Client ¶
func NewClient ¶
func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) ChangeAgePic ¶
func (c *Client) ChangeAgePic(request *ChangeAgePicRequest) (response *ChangeAgePicResponse, err error)
用户上传一张人脸图片,基于人脸编辑与生成算法,输出一张人脸变老或变年轻的图片,支持实现人脸不同年龄的变化。
func (*Client) SwapGenderPic ¶
func (c *Client) SwapGenderPic(request *SwapGenderPicRequest) (response *SwapGenderPicResponse, err error)
用户上传一张人脸图片,基于人脸编辑与生成算法,输出一张人脸性别转换的图片。男变女可实现美颜、淡妆、加刘海和长发的效果;女变男可实现加胡须、变短发的效果。
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 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
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
func (*SwapGenderPicResponse) ToJsonString ¶
func (r *SwapGenderPicResponse) ToJsonString() string
Click to show internal directories.
Click to hide internal directories.