const config = {
module: {
beautify: true,
segmentation: true
segmentationLevel: 0
},
auth: authData,
input: stream,
beautify: {
whiten: 0.1,
dermabrasion: 0.3,
eye: 0.2,
chin: 0,
lift: 0.1,
shave: 0.2
},
background: {
type: 'blur'
}
}
const sdk = new ArSdk(
config
)
Note:
Keep the following in mind:
Segmentation is supported on both mobile and desktop browsers.
Because WebRTC does not support alpha channels, you can only use transparent backgrounds locally. Background transparency will not work after publishing.
Background transparency is supported on desktop Chrome and Firefox, but not supported on desktop or mobile Safari.
Starting from version 1.0.19 and above, switching background segmentation models is supported, with parameters: 0, 1, 2.
Level 0 has the best performance but relatively average segmentation results.
Level 1 has a moderate performance and effect.
Level 2 has the best segmentation results and the longest inference time, suitable for applications with high requirements for segmentation effects and low performance requirements.
Was this page helpful?