Created
January 21, 2019 16:53
-
-
Save elbruno/013078a34097ce1decb45bbf3a527aa1 to your computer and use it in GitHub Desktop.
CVOnnxObjectDetectionChanges.cs
This file contains 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
public sealed class modelOutput | |
{ | |
public TensorFloat Model_outputs0 = TensorFloat.Create(new long[] { 1, 4 }); | |
} | |
... | |
public async Task<IList<PredictionModel>> PredictImageAsync(VideoFrame image) | |
{ | |
var output = new modelOutput(); | |
var imageFeature = ImageFeatureValue.CreateFromVideoFrame(image); | |
var bindings = new LearningModelBinding(Session); | |
bindings.Bind("data", imageFeature); | |
bindings.Bind("model_outputs0", output.Model_outputs0); | |
var result = await Session.EvaluateAsync(bindings, "0"); | |
return Postprocess(output.Model_outputs0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment