Skip to content

Utilizing Apple's Vision Framework to center faces in CGImage.

License

Notifications You must be signed in to change notification settings

Ancestry/FaceCrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

FaceCrop

CGImage extension that utilizes Apple's Vision Framework to detect and center faces.

Example

Usage

cgImage.faceCrop { [weak self] result in
    switch result {
    case .success(let cgImage):
        DispatchQueue.main.async { self?.imageView.image = UIImage(cgImage: cgImage) }
    case .notFound, .failure( _):
        print("error")
    }
}

If you need to crop a UIImage - you can always access its CGImage by calling .cgImage.

===

For more information consider visiting this in-depth artictle on Medium.

Huge thanks to Anastasios Grigoriou for his work on this project!

About

Utilizing Apple's Vision Framework to center faces in CGImage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages