Ben Butterworth
Ben Butterworth

Reputation: 28948

VNDetectFaceLandmarksRequest not working on m1 macs with iOS 14 simulator? (Unspecified error)

Why are new simulators on M1 (iPhone 12, iOS 14.3) providing unspecified error when I use the vision framework. I guess the iOS 14 simulators don't have access to a working vision framework? It can't be the code, since it does give me results on x86_64 (Intel) macs and also on my M1 mac running iPhone 11 simulator (iOS 13.7, which runs in Intel 80486 emulation).

let handler = VNImageRequestHandler(cgImage: image)
let request = VNDetectFaceLandmarksRequest { request, error in
    guard error == nil else { // <-- The error is `unspecified error`
          finish()
          return
    }
    if let faceObservations = request.results as? [VNFaceObservation] {
        outputFaceImages = faceObservations.map { image.cropping(to: $0.boundingBox)! }
    }
    finish()
}

do {
    try handler.perform([request])
} catch {
    finish()
}

Unfortunately, I get an unspecified error: XCode debugger screenshot

Upvotes: 3

Views: 459

Answers (0)

Related Questions