How can I do face detection in realtime just as \"Camera\" does? like white round shape around and over the face. I use AVCapturSession
. I found that the image I s
To anyone looking for a working and update example, Apple's website has the best I have found so far: https://developer.apple.com/documentation/vision/tracking_the_user_s_face_in_real_time.
You have to change two lines: in AppDelegate.swift
you need to change line 15
to
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
And in ViewController.swift
you need to change line 462
to
let cameraIntrinsicData = CMGetAttachment(sampleBuffer, kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix, nil)