我在我的应用中使用Google Mobile Vision。我得到一个无法识别的选择器lldb崩溃。我已经将问题缩小到这行代码......
var faceDetector = GMVDetector.init(ofType: GMVDetectorTypeFace, options: options)
这是变量options
:
let options = [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all, GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all, GMVDetectorFaceTrackingEnabled: false] as [String : Any]
options
有什么问题吗?我查看了其他SO帖子,发现大多数问题都来自字典。
我该如何解决这个问题?
使用枚举的原始值,GMVDetectorFaceLandmark.all.rawValue
等。
例如:
var faceDetector = GMVDetector(ofType: GMVDetectorTypeFace, options: [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all.rawValue,
GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all.rawValue,
GMVDetectorFaceMinSize: 0.3,
GMVDetectorFaceTrackingEnabled: true])