Skip to content

Commit 31a72b9

Browse files
committed
Sync classification results
1 parent 735edb8 commit 31a72b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Samples/WinMLSamplesGallery/WinMLSamplesGallery/Samples/DXResourceBindingORT/DXResourceBindingORT.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ private async void LaunchWindow(object sender, RoutedEventArgs e)
4646
private async void ClassifyCube()
4747
{
4848
int i = 0;
49+
float[] prev_results = { };
4950
while (true)
5051
{
5152
if (pageExited)
@@ -54,10 +55,13 @@ private async void ClassifyCube()
5455
break;
5556
}
5657
float[] results = await Task.Run(() => WinMLSamplesGalleryNative.DXResourceBinding.EvalORT());
58+
if (i == 0)
59+
prev_results = results;
5760
// The first evaluation may return null so move to the next iteration
5861
if (results == null)
5962
continue;
60-
UpdateClassificationResults(results);
63+
UpdateClassificationResults(prev_results);
64+
prev_results = results;
6165
System.Threading.Thread.Sleep(1000);
6266
i++;
6367
}

0 commit comments

Comments
 (0)