Skip to content

Instantly share code, notes, and snippets.

@backnotprop
Created January 13, 2018 16:37
Show Gist options
  • Save backnotprop/a130f96dc66e7bf9595a2dc4febc0707 to your computer and use it in GitHub Desktop.
Save backnotprop/a130f96dc66e7bf9595a2dc4febc0707 to your computer and use it in GitHub Desktop.
//
// StyleTransferInput.swift
// StyleTransfer
//
import CoreML
class StyleTransferInput : MLFeatureProvider {
var input: CVPixelBuffer
var featureNames: Set<String> {
get {
return ["img_placeholder__0"]
}
}
func featureValue(for featureName: String) -> MLFeatureValue? {
if (featureName == "img_placeholder__0") {
return MLFeatureValue(pixelBuffer: input)
}
return nil
}
init(input: CVPixelBuffer) {
self.input = input
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment