标签: google-ios-vision

Google Vision API可能存在内存泄漏

我正在尝试创建一个应用程序来处理一组框架,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)

memory-leaks ios google-vision google-ios-vision

10
推荐指数
0
解决办法
283
查看次数

启动GMVDetector失败

我使用以下代码在我的Swift 3.1项目中使用GoogleMobileVision/Barcode检测器:

GMVDetector(ofType: GMVDetectorTypeBarcode, options: nil)
Run Code Online (Sandbox Code Playgroud)

但在日志中显示:

日志

似乎iOS中的GoogleMobileVision是封闭源代码,所以我无法真正看到实现方面发生了什么

关于这里可能发生什么的任何想法?

swift google-ios-vision

5
推荐指数
1
解决办法
691
查看次数

完成错误 - 代码:-1009 当互联网没有连接时

我们正在使用 Google SDK,例如登录、地图和分析。用于登录的 Facebook SDK。Alamofire 和 ObjectMapper 用于网络和 JSON 解析。数据库领域。

当没有互联网连接时,我在控制台上收到以下错误。我已经验证这些不是我们的应用程序错误。

TIC TCP Conn 失败 [45:0x1c8178240]: 1:50 Err(50) 任务 <293866EE-82E6-4740-AEAF-83A1BB11E98A>.<1> HTTP 加载失败(错误代码:-1009)

谁能解释哪个框架记录了这个错误。

facebook-ios-sdk swift alamofire google-ios-vision

5
推荐指数
1
解决办法
1790
查看次数

GoogleMobileVision GoogleSignIn使用Cocoapods复制符号?

我正在使用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安装两个没有冲突---我删除了所有冲突日志 - 如果需要,我可以添加它们.

duplicate-symbol cocoapods google-signin google-ios-vision

2
推荐指数
1
解决办法
372
查看次数