tencent cloud

Tencent Effect SDK

제품 소개
기본 개념
제품 장점
시나리오
구매 가이드
가격 리스트
구매 안내
연체 및 환불
Demo 체험
무료 평가판 License
License 가이드
License 추가 및 연장(모바일)
FAQ
SDK 다운로드
기능 설명
SDK 다운로드
SDK 통합 가이드
Tencent Effect SDK 통합하기
원자 기능 통합 가이드
API 문서
iOS
Android
Flutter
기능 사례
SDK 패키지 축소
뷰티 필터 시나리오의 권장 매개변수
UGSV 엔터프라이즈 버전 마이그레이션 가이드
서드 파티 퍼블리셔 Tencent Effect 통합(Flutter)
FAQ
일반 질문
기술 관련 질문
License 관련
TE SDK 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
문서Tencent Effect SDK

Configuring Effects

포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-05-08 16:30:10
The Tencent Effect SDK offers beautification effects, filters, and special effects. For filters and special effects, you need to get the material list first and configure them in the SDK by specifying the effect ID.

Beautification

You can pass in beautification parameters during initialization. You can also call setBeautify of the SDK to set beautification effects.
Currently, the SDK supports the following beautification effects:
type BeautifyOptions = {
whiten?: number, // The brightening effect. Value range: 0-1.
dermabrasion?: number // The smooth skin effect. Value range: 0-1.
lift?: number // The slim face effect. Value range: 0-1.
shave?: number // The face width. Value range: 0-1.
eye?: number // The big eyes effect. Value range: 0-1.
chin?: number // The chin effect. Value range: 0-1.
// The following parameters are only available in version 1.0.11 and above
darkCircle?: number; // The dark circle effect. Value range: 0-1.
nasolabialFolds?: number; // The nasolabial folds effect. Value range: 0-1.
cheekbone?: number; // The cheek bone effect. Value range: 0-1.
head?: number; // The head effect. Value range: 0-1.
eyeBrightness?: number; // The eye brightness effect. Value range: 0-1.
lip?: number; // The lip effect. Value range: 0-1.
forehead?: number; // The forehead effect. Value range: 0-1.
nose?: number; // The nose effect. Value range: 0-1.
usm?: number; // The distinct effect. Value range: 0-1.
}
Call setBeautify of the SDK to set beautification effects:
sdk.setBeautify({
whiten: 0.2,
dermabrasion: 0,
lift: 0.3,
shave:0.1,
eye: 0.9,
chin: 0,
……
})

Filters

Given the relatively high cost of filter design, we offer some built-in filters which you can use directly.
1. Get the built-in filter list:
const filterList = await sdk.getCommonFilter()
2. Set the filter:
sdk.setFilter(filterList[0].EffectId, 0.5)

Special Effects

You can use the SDK’s built-in effects or effects you customized in the RT-Cube console. To learn about how to customize effects, please contact us.
// Get the built-in effects
// By default, both makeup effects and stickers are returned. You can also use the `Label` parameter to specify the category of materials to return.
const presetEffectList = await sdk.getEffectList({
Type: 'Preset'
// Label: ['Sticker'] (Return only stickers)
})

// Get the custom effects
const customEffectList = await sdk.getEffectList({
Type: 'Custom'
})

// Pass in the request parameters of `getEffectList`
const lipList = await sdk.getEffectList({
PageNumber: 0,
PageSize: 10,
Name: '',
Label: ['Lip makeup'], // Specify the specific type of materials to return
Type: 'Custom'
})
const eyeList = await sdk.getEffectList({
PageNumber: 0,
PageSize: 10,
Name: '',
Label: ['Eye makeup'], // Specify the category of resources to return
Type: 'Custom'
})
// Use an effect
sdk.setEffect([lipList[0].EffectId, eyeList[0].EffectId])

// Specify the effect to use and the strength of the effect
sdk.setEffect([
{
id: lipList[0].EffectId,
intensity: 0.5
},
{
id: eyeList[0].EffectId,
intensity: 0.7
})
// Set only the filter strength
sdk.setEffect([
{
id: lipList[0].EffectId,
intensity: 0.5,
filterIntensity: 0
},
{
id: eyeList[0].EffectId,
intensity: 0.7,
filterIntensity: 1
})
Note:
When customizing a special effect, you can add a filter to the effect. In such cases, you can use filterIntensity to adjust the strength of the filter separately.

Disabling Detection

The performance overhead of AI detection is high. To reduce resource consumption, the SDK will automatically disable AI detection when no effects are used and enable AI detection again when effects are applied.
// Clear all effect settings to disable AI detection
sdk.setBeautify({
whiten: 0,
dermabrasion: 0,
lift: 0,
shave:0,
eye: 0,
chin: 0,
…… // reset all parameters to 0
})
sdk.setEffect('')


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백