Skip to content

Instantly share code, notes, and snippets.

@gali8
Created September 15, 2017 16:20
Show Gist options
  • Save gali8/816b89fd8732fe60c7608aa4a07f5a76 to your computer and use it in GitHub Desktop.
Save gali8/816b89fd8732fe60c7608aa4a07f5a76 to your computer and use it in GitHub Desktop.
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