Created
September 15, 2017 16:20
-
-
Save gali8/816b89fd8732fe60c7608aa4a07f5a76 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 resetOnError() { | |
DispatchQueue.main.async { | |
self.imgPicture?.image = nil | |
self.lblGender?.text = self.noPixels | |
} | |
} | |
func setGender(prob: MLMultiArray?) { | |
DispatchQueue.main.async { | |
guard let probArray = prob, probArray.count >= 2 else { | |
self.lblGender?.text = self.error | |
return | |
} | |
//0 => M | |
//1 => F | |
let m = probArray[0].doubleValue | |
let f = probArray[1].doubleValue | |
self.lblGender?.text = m > f ? self.male : self.female | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment