-[_SwiftValue integerValue]:无法识别的选择器发送到实例 0x60000044d560 使用 Google Mobile Vision 时出错

cod*_*der 5 dictionary ios google-vision swift4

我在我的应用程序中使用 Google Mobile Vision。我遇到无法识别的选择器 lldb 崩溃。我已将问题范围缩小到这行代码......

   var faceDetector = GMVDetector.init(ofType: GMVDetectorTypeFace, options: options)
Run Code Online (Sandbox Code Playgroud)

这是变量options

let options = [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all, GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all, GMVDetectorFaceTrackingEnabled: false] as [String : Any]
Run Code Online (Sandbox Code Playgroud)

有什么问题吗options?我查看了其他 SO 帖子,发现大多数问题都源于字典。

我该如何解决这个问题?

sle*_*rfx 10

使用枚举的原始值GMVDetectorFaceLandmark.all.rawValue等。

例如:

var faceDetector = GMVDetector(ofType: GMVDetectorTypeFace, options: [GMVDetectorFaceLandmarkType: GMVDetectorFaceLandmark.all.rawValue,
                                                                               GMVDetectorFaceClassificationType: GMVDetectorFaceClassification.all.rawValue,
                                                                               GMVDetectorFaceMinSize: 0.3,
                                                                               GMVDetectorFaceTrackingEnabled: true])
Run Code Online (Sandbox Code Playgroud)