Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created December 12, 2019 12:44
Show Gist options
  • Save mdfarragher/c58c8338515308a3bee8347bcedb8569 to your computer and use it in GitHub Desktop.
Save mdfarragher/c58c8338515308a3bee8347bcedb8569 to your computer and use it in GitHub Desktop.
// create a batch to evaluate the model on
var evaluationBatch = StyleTransfer.CreateBatch(model, labels);
// infer the image from the model
Console.WriteLine("Inferring transformed image...");
var img = model.InferImage(evaluationBatch);
// show image
var mat = new Mat(imageHeight, imageWidth, OpenCvSharp.MatType.CV_8UC3, img, 3 * imageWidth);
Cv2.ImShow("Image With Style Transfer", mat);
Cv2.WaitKey();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment