我正在尝试创建一个应用程序来处理一组框架,jpg使用Google-vision API 存储到应用程序中.
管道很简单.
1)我用一些选项创建了探测器:
_options = @{
GMVDetectorFaceLandmarkType : @(GMVDetectorFaceLandmarkAll),
GMVDetectorFaceClassificationType : @(GMVDetectorFaceClassificationAll),
GMVDetectorFaceTrackingEnabled : @(NO)
};
_faceDetector = [GMVDetector detectorOfType:GMVDetectorTypeFace options:_options];
Run Code Online (Sandbox Code Playgroud)
2)我用这种方法读取了一个框架:
UIImage *image = [UIImage imageWithContentsOfFile:imFile];
Run Code Online (Sandbox Code Playgroud)
imFile中包含的路径是正确的,我可以看到图像表示
3)最后,我处理框架:
NSArray<GMVFaceFeature *> *faces = [_faceDetector featuresInImage:image options:nil];
Run Code Online (Sandbox Code Playgroud)
使用这段代码我可以处理一些帧,但是当分析它们中的很多时,应用程序的内存使用量不断增加,应用程序会自动被杀死.
我试图跟踪内存泄漏,但据我追踪它,它来自最后一部分内部,内部 [detector featuresInImage...]
有什么我做错了,或者里面有内存泄漏?我试图从谷歌找到任何问题,但无法找到它.
编辑:
以下是我对探测器的每个结果所做的事情:
if ([faces count]>0){
GMVFaceFeature *face = [faces objectAtIndex:0];
NSFileHandle *myHandle = [NSFileHandle fileHandleForWritingAtPath:filename];
[myHandle seekToEndOfFile];
NSString* lineToWrite = [NSString stringWithFormat:@"%u",fNumber];
lineToWrite = [lineToWrite stringByAppendingString:[NSString stringWithFormat:@",%f",face.smilingProbability]];
lineToWrite = [lineToWrite stringByAppendingString:@"\n"];
NSError *errorWrite;
[myHandle writeData:[lineToWrite …Run Code Online (Sandbox Code Playgroud) 我使用以下代码在我的Swift 3.1项目中使用GoogleMobileVision/Barcode检测器:
GMVDetector(ofType: GMVDetectorTypeBarcode, options: nil)
Run Code Online (Sandbox Code Playgroud)
但在日志中显示:
似乎iOS中的GoogleMobileVision是封闭源代码,所以我无法真正看到实现方面发生了什么
关于这里可能发生什么的任何想法?
我们正在使用 Google SDK,例如登录、地图和分析。用于登录的 Facebook SDK。Alamofire 和 ObjectMapper 用于网络和 JSON 解析。数据库领域。
当没有互联网连接时,我在控制台上收到以下错误。我已经验证这些不是我们的应用程序错误。
TIC TCP Conn 失败 [45:0x1c8178240]: 1:50 Err(50) 任务 <293866EE-82E6-4740-AEAF-83A1BB11E98A>.<1> HTTP 加载失败(错误代码:-1009)
谁能解释哪个框架记录了这个错误。
我正在使用CocoaPods添加两个框架.
target 'TestGoogleLib' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for TestGoogleLib
pod 'GoogleMobileVision'
pod 'GoogleSignIn'
end
Run Code Online (Sandbox Code Playgroud)
但是当我跑 - 我得到重复的错误.似乎两个框架都使用相同的文件.
我的Pod版本是1.5.3
duplicate symbol _OBJC_IVAR_$_MDMPasscodeCache._localAuthenticationInfo in:
ld: 13 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
如何使用CocoaPods安装两个没有冲突---我删除了所有冲突日志 - 如果需要,我可以添加它们.