12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // TensorFlowWrapper.m
- // LenzCameraNativeModuleForRN
- //
- // Created by 王昭威 on 2023/1/29.
- //
- #import "TensorFlowWrapper.h"
- @implementation TensorFlowWrapper
- @synthesize tensorFlow = _tensorFlow;
- - (BOOL)remake:(CVPixelBufferRef)buffer image:(UIImage *)image{
- id tensorFlow = [[TensorFlowWrapper alloc] init].tensorFlow;
- if(tensorFlow == nil){
- NSLog(@"load tensor flow failed");
- return NO;
- }
-
- NSNumber *remake = [tensorFlow performSelector:@selector(remake:) withObject:(__bridge id)(buffer)];
- float value = [remake floatValue];
- NSLog(@"remake:value:%@",remake);
- return value > 0.8;
- }
- - (id)tensorFlow {
- if (!_tensorFlow) {
- Class tfClass = NSClassFromString(@"LenzTensorFlow");
- _tensorFlow = [[tfClass alloc] init];
- }
- return _tensorFlow;
- }
- @end
|