title: Slow face detection Firebase MLKit
body: <p>Started playing around with MLKit face detectors with the front-facing camera, but it's really slow on processing faces</p>
  
  <pre><code>func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
  
      print("Picture at ", Date())
  
  
      let visionImage = VisionImage(buffer: sampleBuffer)
      visionImage.metadata = metadata
  
  
      faceDetector?.detect(in: visionImage) { (faces, error) in
          guard error == nil, let faces = faces, !faces.isEmpty else {
              // Error. You should also check the console for error messages.
              let errorString = error?.localizedDescription
              print("Face detection failed with error: \(errorString)")
              return
          }
  
    }
  </code></pre>
  
  <p>Where am i going wrong?</p>