提交工单
咨询集成、功能及报价等问题
在使用 ZegoEffects SDK 提供的 AI 功能前,请在 下载 页面,获取最新版本的 AI 资源或模型:
指定 AI 资源和模型的绝对路径。请在 下载 页面,获取最新版本的 AI 资源或模型(bundle/model 文件)。
// 传入模型和资源的绝对路径。美颜,美型,美白,白牙,红润,挂件贴纸功能均须导入资源。大眼、瘦脸、人像分割功能须导入模型。
NSString *commonResources = [[NSBundle mainBundle] pathForResource:@"CommonResources" ofType:@"bundle"];
NSString *faceWhiteningResources = [[NSBundle mainBundle] pathForResource:@"FaceWhiteningResources" ofType:@"bundle"];
NSString *pendantResources = [[NSBundle mainBundle] pathForResource:@"PendantResources" ofType:@"bundle"];
NSString *teethWhiteningResources = [[NSBundle mainBundle] pathForResource:@"TeethWhiteningResources" ofType:@"bundle"];
NSString *rosyResources = [[NSBundle mainBundle] pathForResource:@"RosyResources" ofType:@"bundle"];
// 传入人脸识别模型的绝对路径。人脸检测、大眼、瘦脸功能均须导入
NSString *faceDetectionModelPath = [[NSBundle mainBundle] pathForResource:@"FaceDetectionModel" ofType:@"model"];
// 传入人像分割模型的绝对路径。AI 人像分割功能须导入
NSString *segmentationModelPath = [[NSBundle mainBundle] pathForResource:@"SegmentationModel" ofType:@"model"];
NSArray<NSString *> * resourcesList = @[commonResources, faceWhiteningResources, pendantResources, teethWhiteningResources, rosyResources,faceDetectionModelPath,segmentationModelPath];
在调用 create 接口创建对象之前,先调用 setResources 接口传入模型和资源路径列表,加载模型和资源。
// 传入模型和资源路径列表,必须在 create 之前调用
[ZegoEffects setResources:resourcesList];
当前 ZegoEffects SDK 支持的模型和资源,请参考下表:
资源/模型 | 描述 | 支持功能 |
---|---|---|
CommonResources | 美颜美型通用资源 | 美颜、美型 |
FaceWhiteningResources | 美白颜色查找表资源 | 美白 |
PendantResources | 挂件贴纸资源 | 挂件 |
RosyResources | 红润颜色查找表资源 | 红润 |
TeethWhiteningResources | 白牙颜色查找表资源 | 白牙 |
FaceDetectionModel | 人脸检测模型 | 人脸检测、大眼、瘦脸 |
SegmentationModel | 人像分割模型 | 人像分割 |
联系我们
文档反馈