Last active
May 29, 2021 03:14
-
-
Save anupamchugh/3ce30c61fda57463c77704fc6c537038 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 visionRequestDidComplete(request: VNRequest, error: Error?) { | |
DispatchQueue.main.async { | |
if let observations = request.results as? [VNCoreMLFeatureValueObservation], | |
let segmentationmap = observations.first?.featureValue.multiArrayValue { | |
let segmentationMask = segmentationmap.image(min: 0, max: 1) | |
self.outputImage = segmentationMask!.resizedImage(for: self.inputImage.size)! | |
maskInputImage() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment