I'm trying to detect face. It can not detect because handleFaces is not called. I would like to know why is it not called and how I can solve if I would like to detect face.
faceDetectionRequest = VNDetectFaceRectanglesRequest(completionHandler: self.handleFaces)
func handleFaces(request: VNRequest, error: Error?) {
DispatchQueue.main.async {
//perform all the UI updates on the main queue
guard let results = request.results as? [VNFaceObservation] else { return }
self.myView.removeMask()
for face in results {
self.myView.drawFaceboundingBox(face: face)
}
}
}
Please help me to solve this.