Created
January 13, 2018 16:37
-
-
Save backnotprop/a130f96dc66e7bf9595a2dc4febc0707 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
// | |
// 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