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

375 views Asked by At

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

0

There are 0 answers