This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |