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
  • Import resources and models

Import resources and models

Last updated:2025-04-15 16:24

Introduction

This document will introduce how to import the AI resources and models provided by ZegoEffects SDK.

Implementation Steps

  1. Before using the AI features provided by ZegoEffects SDK, please download the latest version of AI resources and models (files with the suffix bundle or model) from the downloads page of the SDK, and copy them to your project for later use.

    If you need to use functions such as Face beautification, Face shape retouch, Skin tone enhancement, Teeth whitening, Cheek blusher, Stickers, Eyes enlarging, Face sliming, and Portrait segmentation, please import the corresponding resources and models from the SDK package first.

  2. Specify the absolute path of the AI resources and models. Please download the latest version of AI resources and models (files with the suffix bundle or model) from the downloads page.

    // Pass in the absolute paths of the models and resources. Resources and models for Face beautification, Face shape retouch, Skin tone enhancement, Teeth whitening, Cheek blusher, Stickers, Eyes enlarging, Face sliming, and Portrait segmentation need to be imported.
    NSString *commonResources = [[NSBundle mainBundle] pathForResource:@"CommonResources" ofType:@"bundle"];
    NSString *faceWhiteningResources = [[NSBundle mainBundle] pathForResource:@"FaceWhiteningResources" ofType:@"bundle"];
    // Only versions before 2.0.0 support Stickers feature
    NSString *pendantResources = [[NSBundle mainBundle] pathForResource:@"PendantResources" ofType:@"bundle"];
    NSString *teethWhiteningResources = [[NSBundle mainBundle] pathForResource:@"TeethWhiteningResources" ofType:@"bundle"];
    NSString *rosyResources = [[NSBundle mainBundle] pathForResource:@"RosyResources" ofType:@"bundle"];
    // Only supported in version 2.0.0 or later, resources for clarity function
    NSString *clarityResources = [[NSBundle mainBundle] pathForResource:@"ClarityResources" ofType:@"bundle"];
    
    // Pass in the absolute path of the face detection model. Face detection, Eyes enlarging, and Face sliming functions require importing this model.
    NSString *faceDetectionModelPath = [[NSBundle mainBundle] pathForResource:@"FaceDetectionModel" ofType:@"model"];
    
    // Pass in the absolute path of the portrait segmentation model. Portrait segmentation function requires importing this model.
    NSString *segmentationModelPath = [[NSBundle mainBundle] pathForResource:@"SegmentationModel" ofType:@"model"];
    
    NSArray<NSString *> * resourcesList = @[commonResources, faceWhiteningResources, pendantResources, teethWhiteningResources, rosyResources,faceDetectionModelPath,segmentationModelPath];
    
    // Adjust skin color resources (Only supported in version 2.0.0 or later. Options: meihei, maise, lengbai, nuanbai, fenbai)
    // Example: meihei (dark skin)
    NSString *skinColorFolderPath = [[NSBundle mainBundle] pathForResource:@"SkinColorResources" ofType:nil];
    NSString *skinColorBundlePath = [skinColorFolderPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle", @"meihei"]];
  3. Before calling the create interface to create an object, call the setResources interface to pass in the model and resource path list to load the models and resources.

    // Pass in the model and resource path list, must be called before create
    [ZegoEffects setResources:resourcesList];

Supported Models and Resources

Please refer to the table below for the models and resources supported by the current ZegoEffects SDK:

Resource/Model Description Supported Functions
CommonResources Common resources for Face beautification and Face shape retouch Face beautification, Face shape retouch
FaceWhiteningResources Color lookup table resources for skin tone enhancement. Skin tone enhancement
PendantResources Sticker resources(Only versions before 2.0.0 support) Stickers
RosyResources Color lookup table resources for cheek blusher Cheek blusher
TeethWhiteningResources Color lookup table resources for teeth whitening Teeth whitening
FaceDetectionModel Face detection model Face detection, eyes enlarging, and face slimming
SegmentationModel Portrait segmentation model Portrait segmentation
SkinColorResources Skin color adjustment resources for Face beautification Dark skin, Wheatish, Cold white, Warm white, Pink white
ClarityResources Resources for clarity function in Face beautification Clarity
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code