Documentation
AI_Vision AI Effects
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • AI Effects
  • Getting started
  • Configure device performance levels

Configure device performance levels

Last updated:2025-01-09 16:40

Introduction

AI Effects supports configuring the device performance level that the SDK runs on, and can ensure that the AI Face beautification function can run smoothly and stably by configuring different Face beautification effects on devices with different performance levels. It is mainly used when the device performance is not sufficient to run advanced effects smoothly, and the goal of smooth operation is achieved by reducing the effects of some effects.

Device Performance Level Enumeration Effect Difference
Low Level LOW = 1 Skin smoothing effect is average, skin changing effect is average, beauty makeups effect is average, acne and spot removal effect is average
Medium Level MIDDLE = 2 Skin smoothing effect is good, skin changing effect is good, beauty makeups effect is average, acne and spot removal effect is average
High Level HIGH = 3 Skin smoothing effect is good, skin changing effect is good, beauty makeups effect is good, acne and spot removal effect is good

If the developer does not actively configure the device performance level, the default device performance level is HIGH, which is a high-performance device.

Steps to Use

If the same device is used to configure the performance level in "Method 1" and "Method 2" respectively, the performance level configured by the configuration file in "Method 2" has a higher priority.

Method 1: Actively Get and Configure

  1. (Optional) Use getDeviceLevel to get the current device performance level.
    int deviceLevel = ZegoEffects.getDeviceLevel().value();
  1. Before calling the create interface to create the ZegoEffects object, pass the device performance level to the SDK through setAdvancedConfig, and run the corresponding AI Face beautification effect according to the device performance level.

    ZegoEffectsAdvancedConfig config = new ZegoEffectsAdvancedConfig();
    HashMap<String,String> map = new HashMap<>();
    int deviceLevel = ZegoEffects.getDeviceLevel().value();
    // You can also force the device performance level to be set to another device performance level as shown in the example below
    // Note: Low-performance devices can run Face beautification effects of high-performance devices, but may experience stuttering.
    // int deviceLevel = ZegoEffectsDeviceLevel.HIGH.value(); 
    
    // ZEGO_EFFECTS_DEVICE_LEVEL is an advanced configuration parameter, which can be viewed in ZegoEffects.java
    map.put(ZegoEffects.ZEGO_EFFECTS_DEVICE_LEVEL, String.valueOf(deviceLevel)); 
    config.setAdvancedConfig(map);
    ZegoEffects.setAdvancedConfig(config);

Method 2: Configure via Configuration File

  1. Support customizing the device performance level through the CommonResources.bundle/device_level.json configuration file.
  2. After defining the device performance level, the corresponding device will run the AI Face beautification function according to the level configured in the configuration file.
    {
      ...
      whitelist: {
          // Get Device Name through Build.MODEL, such as HUAWEI P40
          "device_level_MIDDLE" = ["Device Name 1", "Device Name 2"]
      }
    }
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code