This commit is contained in:
nums11 2022-08-01 13:09:43 -07:00
Родитель 735edb8a69
Коммит 31a72b9d75
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -46,6 +46,7 @@ namespace WinMLSamplesGallery.Samples
private async void ClassifyCube() private async void ClassifyCube()
{ {
int i = 0; int i = 0;
float[] prev_results = { };
while (true) while (true)
{ {
if (pageExited) if (pageExited)
@ -54,10 +55,13 @@ namespace WinMLSamplesGallery.Samples
break; break;
} }
float[] results = await Task.Run(() => WinMLSamplesGalleryNative.DXResourceBinding.EvalORT()); float[] results = await Task.Run(() => WinMLSamplesGalleryNative.DXResourceBinding.EvalORT());
if (i == 0)
prev_results = results;
// The first evaluation may return null so move to the next iteration // The first evaluation may return null so move to the next iteration
if (results == null) if (results == null)
continue; continue;
UpdateClassificationResults(results); UpdateClassificationResults(prev_results);
prev_results = results;
System.Threading.Thread.Sleep(1000); System.Threading.Thread.Sleep(1000);
i++; i++;
} }