Skip to content

Instantly share code, notes, and snippets.

@olokobayusuf
Last active September 28, 2021 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olokobayusuf/2e6908eb82dcff3e8bae781844d24eb0 to your computer and use it in GitHub Desktop.
Save olokobayusuf/2e6908eb82dcff3e8bae781844d24eb0 to your computer and use it in GitHub Desktop.
// Fetch the StyleGAN model data from Hub
var modelData = await MLModelData.FromHub("@natsuite/style-gan");
// Create the model // This is actually being created server-side
var model = modelData.Deserialize();
// Create the StyleGAN Hub predictor
var predictor = new StyleGANHubPredictor(model);
// Run style transfer in the cloud using NatML Hub
Texture2D content = ..., style = ...;
Texture2D result = await predictor.Predict(content, style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment