![]() ImageFeatureValue image = ImageFeatureValue.CreateFromVideoFrame(videoFrame) Ĭonsole.WriteLine("Failed to load/bind image") VideoFrame videoFrame = VideoFrame.CreateWithSoftwareBitmap(softwareBitmap) SoftwareBitmap softwareBitmap = await decoder.GetSoftwareBitmapAsync() IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read) īitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream) StorageFile file = await StorageFile.GetFileFromPathAsync(imagePath) String imagePath = "path\\to\\fish_720.png" ILearningModelFeatureDescriptor input = model.InputFeatures ImageFeatureValue image = ImageFeatureValue::CreateFromVideoFrame(videoFrame) ![]() VideoFrame videoFrame = VideoFrame::CreateWithSoftwareBitmap(softwareBitmap) SoftwareBitmap softwareBitmap = decoder.GetSoftwareBitmapAsync().get() IRandomAccessStream stream = file.OpenAsync(FileAccessMode::Read).get() īitmapDecoder decoder = BitmapDecoder::CreateAsync(stream).get() StorageFile file = StorageFile::GetFileFromPathAsync(imagePath).get() Get the image and bind it to the model's input Hstring imagePath = L"path\\to\\fish_720.png" ILearningModelFeatureDescriptor input = model.InputFeatures().GetAt(0) In this example the image is called "fish_720.png". We will pass in an image that is located in the same path as our model. Next, we will bind an input for our first model.LearningModelBinding binding2 = new LearningModelBinding(session2) LearningModelBinding binding1 = new LearningModelBinding(session1) ![]() The following lines of code will create bindings for each session:.Not doing so would result in additional data movement out of the GPU and into the CPU, which would reduce performance. In order to reap the performance benefits of chaining, you need to create identical GPU sessions for all of your models. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |