Created
January 13, 2018 17:18
-
-
Save backnotprop/75a703bb20176cc2ad2b6acd68ab5ccf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private func stylizeImage(cgImage: CGImage, model: MLModel) -> CGImage { | |
// size can change here if you want, remember to run right sizes in the fst evaluating script | |
let input = StyleTransferInput(input: pixelBuffer(cgImage: cgImage, width: 883, height: 720)) | |
// model.prediction will run the style model on input image | |
let outFeatures = try! model.prediction(from: input) | |
// we get the image buffer after | |
let output = outFeatures.featureValue(for: "add_37__0")!.imageBufferValue! | |
// remaining code to convert image buffer here ..... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment