Skip to content

Commit

Permalink
v8.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangxiaopenyou committed Nov 18, 2022
1 parent 71e690c commit 35cd556
Show file tree
Hide file tree
Showing 78 changed files with 320 additions and 596 deletions.
4 changes: 2 additions & 2 deletions FULiveDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 65;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 35A6KD62ZJ;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -2650,7 +2650,7 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 65;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 35A6KD62ZJ;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
Binary file modified FULiveDemo/FURenderKit/FURenderKit.framework/FURenderKit
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### 通过cocoapods集成

```
pod 'FURenderKit', '8.3.1'
pod 'FURenderKit'
```

接下来执行:
Expand Down Expand Up @@ -338,6 +338,33 @@ AI能力相关的功能都通过FUAIKit 加载或获取
/// @param type AI 识别类型
+ (void)setTrackFaceAIType:(FUAITYPE)type;

/// 对输入的图像进行 AI 识别,支持人脸、身体、手指能类型的识别
+ (int)trackFaceWithInput:(FUTrackFaceInput *)trackFaceInput;

/// 图像明显发生改变时调用该接口重置内部检测结果
+ (void)resetTrackedResult;

/// 跟踪到的人脸数量
+ (int)aiFaceProcessorNums;

/// 设置面部参数
+ (void)setFaceTrackParam:(NSString *)param value:(int)value;

/// 获取人脸信息:
+ (int)getFaceInfo:(int)faceId
name:(NSString *)name
pret:(float *)pret
number:(int)number;

/// 设置了InputCameraMatrix之后获取获取人脸信息
+ (int)getRotatedFaceInfo:(int)faceId
name:(NSString *)name
pret:(float *)pret
number:(int)number;

/// 人脸检测置信度
+ (float)fuFaceProcessorGetConfidenceScore:(int)index;

/// 设置跟踪到人脸时每次检测的间隔帧数
/// @param frames 帧数
/// @note 底层默认间隔帧数为7
Expand All @@ -348,33 +375,32 @@ AI能力相关的功能都通过FUAIKit 加载或获取
/// @note 底层默认间隔帧数为7
+ (void)setFaceProcessorDetectEveryFramesWhenNoFace:(int)frames;

/// 对输入的图像进行 AI 识别,支持人脸、身体、手指能类型的识别
+ (int)trackFaceWithInput:(FUTrackFaceInput *)trackFaceInput;

/// 重置身体识别
+ (void)resetHumanProcessor;
/// 设置人脸离开延迟打开或关闭
/// @param enable YES为打开 NO为关闭
+ (void)setFaceDelayLeaveEnable:(BOOL)enable;

/// 跟踪到的人体数量
+ (int)aiHumanProcessorNums;

/// 跟踪到的人脸数量
+ (int)aiFaceProcessorNums;
/// 重置身体识别
+ (void)resetHumanProcessor;

/// 人脸检测置信度
+ (float)fuFaceProcessorGetConfidenceScore:(int)index;
/// 设置人体分割场景类型
+ (void)setHumanSegmentationSceneType:(FUHumanSegmentationSceneType)type;

/// ai手势识别
/// 跟踪到的手势数量
+ (int)aiHandDistinguishNums;

/// 手势识别:获取手势类型
/// 获取手势类型
/// @param handIndex aiHandDistinguishNums返回手的索引
+ (FUAIGESTURETYPE)fuHandDetectorGetResultGestureType:(int)handIndex;

/// 设置未跟踪到手势时每次检测的间隔帧数
/// @param frames 帧数
+ (void)setHandDetectEveryFramesWhenNoHand:(int)frames;

/// 动作识别: actionId index of fuHumanProcessorGetNumResults
+ (int)fuHumanProcessorGetResultActionType:(int)actionId;

/// 设置面部参数
+ (void)setFaceTrackParam:(NSString *)param value:(int)value;
```

其他接口参考 FUAIKit.h
Expand Down Expand Up @@ -408,7 +434,7 @@ beauty.filterName = FUFilterOrigin;
beauty.colorLevel = 0.3;
beauty.redLevel = 0.3;
beauty.blurLevel = 0.7*6;
beauty.blurLevel = 4.2;
beauty.heavyBlur = 0;
beauty.blurType = 3;
Expand All @@ -422,6 +448,7 @@ beauty.removeNasolabialFoldsStrength = 0.0;
beauty.faceShapeLevel = 1.0;
beauty.changeFrames = 0;
beauty.faceShape = 4;
beauty.faceThreed = 0.0;
beauty.eyeEnlarging = 0.4;
beauty.cheekThinning = 0.0;
Expand All @@ -444,6 +471,10 @@ beauty.intensityLowerJaw= 0.0;
beauty.intensityEyeCircle = 0.0;
beauty.intensityBrowHeight = 0.5;
beauty.intensityBrowSpace = 0.5;
beauty.intensityEyeLid = 0.0;
beauty.intensityEyeHeight = 0.5;
beauty.intensityBrowThick = 0.5;
beauty.intensityLipThick = 0.5;
```


Expand All @@ -467,47 +498,55 @@ FUSticker *sticker1 = [[FUSticker alloc] initWithPath:path1 name:@"sticker"];
[[FURenderKit shareRenderKit].stickerContainer removeSticker:sticker1];
```
带属性的特殊贴纸说明:
### 人像分割
初始化一个FUAISegment的实例,修改好参数后可以直接赋值给 FURenderKit或者也可以参考贴纸的方式加入stickerContainer中;修改属性示例如下,属性对应的含义详见FUAISegment.h 注释:
```objective-c
1. 人像分割 FUAISegment - 外轮廓bundle 的用法
NSString *path = [[NSBundle mainBundle] pathForResource:@"human_outline" ofType:@"bundle"];
FUAISegment *outline = [FUAISegment alloc] initWithPath:path name:@"sticker"];
1. 外轮廓bundle的用法
NSString *path = [[NSBundle mainBundle] pathForResource:@"human_outline_740" ofType:@"bundle"];
FUAISegment *outline = [FUAISegment alloc] initWithPath:path name:@"human_outline"];
outline.lineGap = 2.8; //轮廓分割线和人之间的间距
outline.lineSize = 2.8; //轮廓分割线宽度
outline.lineColor = FUColorMake(255/255.0, 180/255.0, 0.0, 0.0); //线的颜色
[[FURenderKit shareRenderKit].stickerContainer addSticker:outline];
[FURenderKit shareRenderKit].segmentation = outline;
1. 人像分割 FUAISegment - 自定义背景视频
2. 自定义背景视频的用法
NSString *path = [[NSBundle mainBundle] pathForResource:@"bg_segment" ofType:@"bundle"];
FUAISegment *segment = [FUAISegment alloc] initWithPath:path name:@"sticker"];
FUAISegment *segment = [FUAISegment alloc] initWithPath:path name:@"bg_segment"];
segment.videoPath = @“背景视频路径”;//NSURL or NSString
[segment startVideoDecode];
//获取视频解析的第一帧图片
UIImage *image = [segment readFirstFrame];
[[FURenderKit shareRenderKit].stickerContainer replaceSticker:outline withSticker:segment completion:nil];
[FURenderKit shareRenderKit].segmentation = segment;
1. 人像分割 FUAISegment - 自定义背景照片
3. 自定义背景照片的用法
segment.setBackgroundImage = @"自定义图片";
2. FUAnimoji - 表情
NSString *path = [[NSBundle mainBundle] pathForResource:@"animoji" ofType:@"bundle"];
FUAnimoji *animoji = [FUAnimoji alloc] initWithPath:path name:@"animoji"];
animoji.flowEnable = YES; //卡通表情是否跟随人物移动而移动, YES,跟随, NO 不跟随
```

3. FUGesture -- 手势
NSString *path = [[NSBundle mainBundle] pathForResource:@"fugesture" ofType:@"bundle"];
FUGesture *gesture = [FUGesture alloc] initWithPath:path name:@"animoji"];
gesture.handOffY = YES; //可以单独调整比心的偏移量,> 0 向上,< 0 向下
### 音乐滤镜

初始化一个FUMusicFilter的实例,修改好参数后可以直接赋值给 FURenderKit或者也可以参考贴纸的方式加入stickerContainer中;修改属性示例如下,属性对应的含义详见FUMusicFilter.h 注释:

4. FUMusicFilter - 音乐滤镜
```objective-c
NSString *path = [[NSBundle mainBundle] pathForResource:@"music" ofType:@"bundle"];
FUMusicFilter *music = [FUMusicFilter alloc] initWithPath:path name:@"music"];
music.musicPath = "音乐文件路径";
[FURenderKit shareRenderKit].musicFilter = music;
```
带属性的特殊贴纸说明:
### 其他带属性的特殊贴纸说明
```objective-c
1. FUAnimoji - 表情
NSString *path = [[NSBundle mainBundle] pathForResource:@"animoji" ofType:@"bundle"];
FUAnimoji *animoji = [FUAnimoji alloc] initWithPath:path name:@"animoji"];
animoji.flowEnable = YES; //卡通表情是否跟随人物移动而移动, YES,跟随, NO 不跟随
2. FUGesture -- 手势
NSString *path = [[NSBundle mainBundle] pathForResource:@"fugesture" ofType:@"bundle"];
FUGesture *gesture = [FUGesture alloc] initWithPath:path name:@"animoji"];
gesture.handOffY = YES; //可以单独调整比心的偏移量,> 0 向上,< 0 向下
```


### 海报换脸
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) BOOL isClearMakeup;

/// 美妆分割,YES为开,NO为关,默认NO
/// @note 建议在高端机型中使用
@property (nonatomic, assign) BOOL makeupSegmentation;

/// 口红类型
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ typedef NS_ENUM(NSInteger, FUDeviceModelType) {
FUDeviceModelTypeiPhone13,
FUDeviceModelTypeiPhone13Pro,
FUDeviceModelTypeiPhone13ProMax,
FUDeviceModelTypeiPhoneSENew,
FUDeviceModelTypeiPhone14,
FUDeviceModelTypeiPhone14Plus,
FUDeviceModelTypeiPhone14Pro,
FUDeviceModelTypeiPhone14ProMax,
FUDeviceModelTypeOthers
};

Expand Down
Binary file modified FULiveDemo/FURenderKit/FURenderKit.framework/Info.plist
Binary file not shown.
Binary file modified FULiveDemo/FURenderKit/Resources/graphics/body_slim.bundle
Binary file not shown.
Binary file modified FULiveDemo/FURenderKit/Resources/graphics/controller_cpp.bundle
Binary file not shown.
Binary file not shown.
Binary file modified FULiveDemo/FURenderKit/Resources/graphics/face_makeup.bundle
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectio
}

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
return 20;
return 16;
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
Expand Down
Binary file modified FULiveDemo/Resource/Animoji/baimao_Animoji.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Animoji/douniuquan_Animoji.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Animoji/hashiqi_Animoji.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Animoji/hetun_Animoji.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Animoji/huangya_Animoji.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Animoji/qgirl_Animoji.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/GestureRecognition/ctrl_flower_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/GestureRecognition/ctrl_rain_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/GestureRecognition/ctrl_snow_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/GreenScreen/green_screen_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/HairBeauty/hair_gradient.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/HairBeauty/hair_normal.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/bg_segment.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/boyfriend1_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/boyfriend2_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/boyfriend3_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/gufeng_zh_fu.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/hez_ztt_fu.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/human_outline_740.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/ice_lm_fu.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/sea_lm_fu.bundle
Binary file not shown.
Binary file modified FULiveDemo/Resource/Segmentation/xiandai_ztt_fu.bundle
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ - (void)combinationMakeupViewDidClickCustomize {

- (void)customizedMakeupViewDidClickBack {
// 返回组合妆时需要判断子妆是否变化
if ([self combinationMakeupIsChangedByCustoming]) {
if (self.combinationMakeupViewModel.selectedIndex >= 0 && [self combinationMakeupIsChangedByCustoming]) {
[self.combinationMakeupView deselectCurrentCombinationMakeup];
}
self.colorPicker.hidden = YES;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 15 additions & 3 deletions FUMakeupComponent/FUMakeupComponent/View/FUCombinationMakeupView.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ - (instancetype)initWithFrame:(CGRect)frame viewModel:(FUCombinationMakeupViewMo
self.viewModel = viewModel;
self.backgroundColor = [UIColor clearColor];
[self configureUI];

// 默认选中
[self.collectionView selectItemAtIndexPath:[NSIndexPath indexPathForItem:self.viewModel.selectedIndex inSection:0] animated:YES scrollPosition:UICollectionViewScrollPositionCenteredHorizontally];
[self refreshSubviews];
[self.viewModel selectCombinationMakeupAtIndex:self.viewModel.selectedIndex complectionHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
[self refreshSubviews];
self.collectionView.userInteractionEnabled = YES;
self.slider.userInteractionEnabled = YES;
self.customizeButton.userInteractionEnabled = YES;
});
}];
}
return self;
}
Expand Down Expand Up @@ -98,8 +106,9 @@ - (void)deselectCurrentCombinationMakeup {
}
dispatch_async(dispatch_get_main_queue(), ^{
[self.collectionView deselectItemAtIndexPath:[NSIndexPath indexPathForItem:self.viewModel.selectedIndex inSection:0] animated:NO];
[self.viewModel selectCombinationMakeupAtIndex:-1 complectionHandler:nil];
[self refreshSubviews];
[self.viewModel selectCombinationMakeupAtIndex:-1 complectionHandler:^{
[self refreshSubviews];
}];
});
}

Expand Down Expand Up @@ -170,6 +179,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collection
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
collectionView.userInteractionEnabled = NO;
self.slider.userInteractionEnabled = NO;
self.customizeButton.userInteractionEnabled = NO;
FUCombinationMakeupCell *selectedCell = (FUCombinationMakeupCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
[selectedCell.indicatorView startAnimating];
[self.viewModel selectCombinationMakeupAtIndex:indexPath.item complectionHandler:^{
Expand All @@ -178,6 +188,7 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa
[self refreshSubviews];
collectionView.userInteractionEnabled = YES;
self.slider.userInteractionEnabled = YES;
self.customizeButton.userInteractionEnabled = YES;
});
}];
}
Expand Down Expand Up @@ -212,6 +223,7 @@ - (UICollectionView *)collectionView {
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.translatesAutoresizingMaskIntoConstraints = NO;
_collectionView.userInteractionEnabled = NO;
[_collectionView registerClass:[FUCombinationMakeupCell class] forCellWithReuseIdentifier:kFUCombinationMakeupCellIdentifierKey];
}
return _collectionView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ @implementation FUCombinationMakeupViewModel {
- (instancetype)init {
self = [super init];
if (self) {
[self selectCombinationMakeupAtIndex:1 complectionHandler:nil];
_selectedIndex = 1;
}
return self;
}

#pragma mark - Instance methods

- (void)selectCombinationMakeupAtIndex:(NSInteger)index complectionHandler:(void (^)(void))complection {
if (index == self.selectedIndex) {
!complection ?: complection();
return;
}
// if (index == self.selectedIndex) {
// !complection ?: complection();
// return;
// }
if (index < 0 || index >= self.combinationMakeups.count) {
self.selectedIndex = -1;
!complection ?: complection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>FUVideoComponent.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
<integer>2</integer>
</dict>
</dict>
</dict>
Expand Down
4 changes: 1 addition & 3 deletions FUVideoComponent/FUVideoComponent/FUVideoWriter.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ - (instancetype)initWithVideoURL:(NSURL *)URL videoSize:(CGSize)size setting:(FU
NSAssert(!CGSizeEqualToSize(size, CGSizeZero), @"size cannot be 0!");

self.videoURL = URL;

self.videoSize = size;
if (!settings) {
settings = [[FUVideoWriterSettings alloc] init];
} else {
self.writerSettings = settings;
}
self.writerSettings = settings;
}
return self;
}
Expand Down
Loading

0 comments on commit 35cd556

Please sign in to comment.