Skip to content

Instantly share code, notes, and snippets.

View atalcott's full-sized avatar

Adam Talcott atalcott

  • Los Altos, California
View GitHub Profile
var textDetector: VisionTextDetector?
func extractCreditCardInformation(image: UIImage) {
// 1
let vision = Vision.vision()
textDetector = vision.textDetector()
// 2
textDetector?.detect(in: VisionImage(image: image)) { [weak self] (features, error) in
guard error == nil else {
var faceDetector: VisionFaceDetector?
func detectFaces(in image: UIImage) {
// 1
let vision = Vision.vision()
let options = VisionFaceDetectorOptions()
options.modeType = .accurate
options.landmarkType = .all
options.classificationType = .all
options.minFaceSize = CGFloat(0.1)