Ios Swift代码“;captureOutput();不检测人脸的方法

Ios Swift代码“;captureOutput();不检测人脸的方法,ios,swift,face-detection,Ios,Swift,Face Detection,请告诉我,如果有任何错误,我在这个代码做 faceDetectorOptions = [CIDetectorAccuracy: CIDetectorAccuracyLow] faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: faceDetectorOptions ) let pixelBuffer : CVPixelBufferRef = CMSampleBufferG

请告诉我,如果有任何错误,我在这个代码做

  faceDetectorOptions  = [CIDetectorAccuracy: CIDetectorAccuracyLow]
    faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: faceDetectorOptions )

    let pixelBuffer : CVPixelBufferRef = CMSampleBufferGetImageBuffer(sampleBuffer)!
    let attachments : CFDictionaryRef  = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, CMAttachmentMode(kCMAttachmentMode_ShouldPropagate))!
    let ciImage     : CIImage   = CIImage(CVPixelBuffer: pixelBuffer, options: attachments as? [String : AnyObject])


     let imageOptions = [CIDetectorSmile : true, CIDetectorEyeBlink : true , CIDetectorImageOrientation : 6 ]
    let features = faceDetector.featuresInImage(ciImage, options: imageOptions)
我看不到任何面孔,这可能有用。 如有任何建议,将不胜感激