private func detectFaces(completion: @escaping ([VNFaceObservation]?) -> Void) {
guard let image = UIImage(named: photos[currentIndex]),
let cgImage = image.cgImage,
let orientation = CGImagePropertyOrientation(rawValue: UInt32(image.imageOrientation.rawValue)) else {
return completion(nil)
}
let request = VNDetectFaceLandmarksRequest()
let handler = VNImageRequestHandler(cgImage: cgImage, orientation: orientation, options: [:])
DispatchQueue.global().async {
try? handler.perform([request])
guard let obervations = request.results else {
return completion(nil)
}
completion(obervations)
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
YamamotoDesu/detecting-number-of-faces
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description or website provided.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published