Sync classification results
This commit is contained in:
Родитель
735edb8a69
Коммит
31a72b9d75
|
@ -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++;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче