Git Product home page Git Product logo

fulivedemo's Introduction

FULiveDemo

中文

FULiveDemo 是 iOS 平台上,集成相芯人脸跟踪及视频特效开发包(简 Nama SDK)的集成示例。

集成了 Faceunity 面部跟踪、美颜、Animoji、道具贴纸、AR面具、换脸、表情识别、音乐滤镜、背景分割、手势识别、哈哈镜、人像光照以及人像驱动等功能。

开发文档

相关文档位于本项目docs目录,包括:

  1. iOS_Nama_Demo_版本更新文档,介绍各版本更新内容。
  2. iOS_Nama_Demo_运行文档.md,介绍如何运行demo。
  3. iOS_Nama_SDK_集成指导文档.md,介绍如何在宿主APP中集成Nama SDK。
  4. iOS_Nama_OC_API_参考文档.md,Nama SDK OC接口定义。

English

FULiveDemo is an integration example, that integrates Faceunity's Face AR SDK (aka Nama SDK) on iOS platform.

This example has integrated various interesting features of Faceunity's Face AR SDK, such as Face landmarks and expressions tracking, Face Beautification, Animoji, Stickers, AR Mask, Face Tranfer, Musical Filters, Background Segmentation, Hand Gestures Detection, Face Warping, Live Photo, etc.

Documents

Related documents locate in ./docs directory, including:

  1. iOS_Nama_Demo_Guide.md, this illustrate how to run this demo.
  2. iOS_Nama_SDK_Integration_Guide.md , this illustrate how to integrate the SDK into the host app.
  3. iOS_Nama_OC_API_Reference.md,this show SDK's iOS Objective-C API Reference.

fulivedemo's People

Contributors

jdbbjd avatar kurtchen1988 avatar lshdfp726 avatar qinneo avatar xiangxiaopenyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fulivedemo's Issues

Error install nama-lite?

In the my pod file have add:

pod 'Nama-lite', :git => 'https://github.com/Faceunity/FULiveDemo.git', :tag => '7.3.2'
After run pod install command have error occur.
`[!] Error installing Nama-lite
[!] Failed to download 'Nama-lite': [!] /usr/bin/git clone https://github.com/Faceunity/FULiveDemo.git /var/folders/_c/1d2ntzdd7gzf8491j6w10sfm0000gn/T/d20231013-20922-1uxf2f --template= --single-branch --depth 1 --branch 7.3.2

Cloning into '/var/folders/_c/1d2ntzdd7gzf8491j6w10sfm0000gn/T/d20231013-20922-1uxf2f'...
warning: Could not find remote branch 7.3.2 to clone.
fatal: Remote branch 7.3.2 not found in upstream origin

`
How can I fix it?

美颜瘦脸的问题

测试发现美颜cheek_thinning设置成0的时候,还是会有瘦脸效果?

请问一下你们自己使用过自己的demo吗

这么大的BUG都没有发现吗?你们的框架只要用一分钟以上,所有的美颜效果皆消失,你们自己的demo也是一样的问题。根本没办法查问题出在哪里!你们自己测试一下问题在哪里吧

demo性能问题

5C上,视频帧率每秒18帧:,iOS 系统版本9.0,没有开滤镜之前,CPU使用率11%左右,一开滤镜瞬间飙到50%了,而且掉帧卡顿严重。
5S上视频18帧,iOS 12,掉帧情况稍好一点。
在8P和XS上,视频帧率每秒24帧,没开滤镜CPU使用率27%左右,开了滤镜CPU使用率飙到60%了。。。

Error installing Nama-lite

When doing a pod install:

    -> Installing Nama-lite (5.9.0)
     > Http download
       $ /usr/bin/curl -f -L -o /var/folders/wr/hmv51gf119746rq0mjbf0wqc0000gn/T/d20210306-17619-2nwmek/file.zip https://www.faceunity.com/sdk/FaceUnity-SDK-iOS-v5.9.0-dev-lite.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.1 cocoapods-downloader/1.4.0'

    [!] Error installing Nama-lite

Cannot see any other error info.

能不能把模拟器架构加上?

以前的 libnama 库是有模拟器 x86_64 架构的,现在的 libCNamaSDK 可能是为了减小下载体积,只有真机架构。你们发布 pod 时应该加了 --skip-import-validation 参数吧?没有模拟器架构会导致 pod 组件化的封装库(封装了相芯的 Nama 库)也得加这个参数,要不然 lint, push 都会失败,加这个参数相当于封装库里的所有代码都不进行 lint 了。另外,SDK 没有模拟器架构,导致 app 也只能真机编译,直接就限制了模拟器调试... 加模拟器架构只会减小 SDK 下载体积,跟打包后的 app 体积没关系。所以,个人觉得不带模拟器架构带来的好处远远大于其造成的麻烦。

希望贵公司能考虑下把模拟器架构加上,或者单独提供下包含 i386 x86_64 的 SDK包也行。相芯 SDK 的功能不需要在模拟器上全部可用,只需要能在模拟器上通过编译。
万分感谢!

P.S. 不知贵公司可有支持 Mac Catalyst 的计划?

sampleBufferCallbackQueue should use SERIAL queue

[_videoOutput setSampleBufferDelegate:self queue:self.captureQueue];

//录制的队列
- (dispatch_queue_t)captureQueue {
    if (_captureQueue == nil) {
        _captureQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
    }
    return _captureQueue;
}

这段代码有问题吧,不应该给 _videoOutput 指定并行的代理回调 queue ;应当创建一个自己的串行 queue;官方的文档如下:

A serial dispatch queue must be used to guarantee that video frames will be delivered in order. The sampleBufferCallbackQueue parameter may not be NULL, except when setting the sampleBufferDelegate to nil.

- (void)setSampleBufferDelegate:(id<AVCaptureVideoDataOutputSampleBufferDelegate>)sampleBufferDelegate queue:(dispatch_queue_t)sampleBufferCallbackQueue;

在7p下我正常打开采集预览,并且设置美颜。这时候我打开手机拍照,切换前置摄像头,然后拍照完毕退出系统拍照,这个时候美颜没有效果。这种情况只有7p会有问题,其它手机没有问题。

流程:
1.采集视频数据,然后通过openGL预览,并且设置美颜,
2.点击按钮,打开系统拍照,这个时候关闭我们自己的视频采集
3.调起系统拍照后,切换为前置摄像头,点击拍照,完成拍照
4.回调系统拍照,重新打开我们的视频采集,预览,设置美颜,发现美颜没有效果了。

这种情况下只有7p手机有问题,其他手机没有问题。

一个关键函数的 Swift 兼容问题

- (CVPixelBufferRef)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer withFrameId:(int)frameid items:(int*)items itemCount:(int)itemCount flipx:(BOOL)flip;

该函数中第三个参数 items:(int*)items 中的 int * 既可以表示 C 语言中的数组,又可以表示 OC 中的 int 型的内存地址,Demo 中是传一个 C 的 int 数组本身,然而在 Swift 里面 int * 会被认为是 int 型的内存地址。但是如果我传入 Int32 数组,会报以下错误(编译器认为该参数是一个 int 型的内存地址):

Cannot convert value of type '[Int32]' to expected argument type 'UnsafeMutablePointer<Int32>!'

利益相关,正在测试集成贵司的 sdk 做动态贴纸,望尽快回复,谢谢。

Is it Support 60 FPS ?

I trying to make a HD video streaming, but the camera feed from Demo is limited to 30 fps only. In the helper, it also state that function change frames frequency is only support value less than 30.

renderPixelBuffer 输出的数据只有一二帧

  • (FUOutput)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer bgraTexture:(GLuint)textureHandle withFrameId:(int)frameid items:(int *)items itemCount:(int)itemCount;
    请教下,这个接口pixelBuffer和textureHandle是什么关系,可以只传textureHandle,pixelBuffer为NULL吗? 目前调用这个接口返回一两帧数据后就一直返回这一两帧数据,请问什么情况下可能出现这种情况?谢谢

一个关于NAMASDK 与 FURenderKit 衔接items 属性的问题。

背景: 我是直接用FURenderKit 框架,然后想用业务逻辑的接口renderPixelBuffer函数。然后items参数,我想通用一套,因为我有用到FURenderKit的一些类以及函数,我不想再单独写一套FUItem逻辑。我想两套通用如何做?

/**
视频处理接口2:
- 将 items 中的道具绘制到 pixelBuffer 中
- 与 视频处理接口1 相比新增 flip 参数,将该参数设置为 YES
可使道具做水平镜像翻转

@param pixelBuffer 图像数据,支持的格式为:BGRA、YUV420SP
@param frameid 当前处理的视频帧序数,每次处理完对其进行加 1 操作,不加 1
将无法驱动道具中的特效动画
@param items 包含多个道具句柄的 int 数组
@param itemCount 句柄数组中包含的句柄个数
@param flip 道具镜像使能,如果设置为 YES 可以将道具做镜像操作
@return 被处理过的的图像数据,返回 nil 视频处理失败
*/

  • (CVPixelBufferRef)renderPixelBuffer:(CVPixelBufferRef)pixelBuffer
    withFrameId:(int)frameid
    items:(int*)items
    itemCount:(int)itemCount
    flipx:(BOOL)flip;

model.enable = NO

FUMainViewController文件里

line 130

FULiveModel *model = (FULiveModel *)self.dataArray[indexPath.section][indexPath.row];
[FUManager shareManager].currentModel = model;

if (!model.enble) {
//为什么我的model.enable = NO
}

编译报错

Showing Recent Messages Undefined symbol: absl::Mutex::ReaderLock()
Showing Recent Messages Undefined symbol: absl::Mutex::ReaderUnlock()
Showing Recent Messages Undefined symbol: _VTCreateCGImageFromCVPixelBuffer
Showing Recent Messages Undefined symbol: absl::Mutex::~Mutex()
Showing Recent Messages Undefined symbol: absl::Mutex::Unlock()
Showing Recent Messages Undefined symbol: absl::Mutex::Lock()

fuGetSystemError = 1 是什么意思?

自从升级了7.0后,renderPixel 老是获得 fuGetSystemError = 1,
可是这回调是空的, fuGetSystemErrorString(fuGetSystemError()) = ""

如果1 是有意义的话, NAMA_ERROR_SEED_RNG_FAILURE (failed to seed the RNG) 又是指什么呢?请给个方案处理。

项目pod update使用master分支出错

你好,
在项目中pod使用'Nama-lite', update报错:
This repository is over its data quota. Purchase more data packs to restore access.

指定'Nama-lite'为5.5.0后正常, 请问master的5.3.0是否有问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.