Created
May 29, 2021 02:54
-
-
Save anupamchugh/3d1f22c0da5c67f9afd94ae1c3c26cd1 to your computer and use it in GitHub Desktop.
This file contains 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
func runVisionRequest() { | |
guard let model = try? VNCoreMLModel(for: DeepLabV3(configuration: .init()).model) | |
else { return } | |
let request = VNCoreMLRequest(model: model, completionHandler: visionRequestDidComplete) | |
request.imageCropAndScaleOption = .scaleFill | |
DispatchQueue.global().async { | |
let handler = VNImageRequestHandler(cgImage: inputImage.cgImage!, options: [:]) | |
do { | |
try handler.perform([request]) | |
}catch { | |
print(error) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment