Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
let image = UIImage(buffer: givenBuffer)!.rescaled(width: desiredWidth, height: desiredHeight)
let buffer = image.buffer
let model = GenderNet()
let prediction = try! model.prediction(data: buffer)
let probabilites = prediction.prob // ['Male': 66.22, 'Female': 22.3212341]
let output = prediction.classLabel // 'Male
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment