CIDetectorAccuracyHigh not working on simulator

Hey all,

Would anyone happen to know why CIDetectorAccuracyHigh won't work on a simulator? It always can't find a face in any image. Can't find anything to suggest it shouldn't work online.

The same code below is able to find a face on sim if I use CIDetectorAccuracyLow:

public func retrieveFacesFrom(_ image: CIImage, completion: @escaping ([Feature]?) -> ()) {
        let ciDetector = CIDetector(ofType: CIDetectorTypeFace,
                                    context: nil,
                                    options: [CIDetectorAccuracy : CIDetectorAccuracyHigh])
        let features = ciDetector?.features(in: image) as? [CIFeature]
        completion(features?.map { Feature(bounds: $0.bounds) })
}

Thanks in advance.

same here! no faces on simulators with CIDetectorAccuracyHigh (all ok on real devices)

Odd bug. My unfortunate workaround is to use CIDetectorAccuracyLow, in the case that we're on an iOS simulator:

#if targetEnvironment(simulator)
let detectorAccuracy = CIDetectorAccuracyLow
#else
let detectorAccuracy = CIDetectorAccuracyHigh
#endif

let options = [CIDetectorAccuracy: detectorAccuracy]
                let faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: options)

I don't love the solution, as it seems like the type of hack that will remain, forgotten, in the codebase, quietly confusing future developers, for the rest of eternity. But, low accuracy works on Simulator and I suppose it doesn't matter too much so long as production users still get the high accuracy detection.

CIDetectorAccuracyHigh not working on simulator
 
 
Q