2020-04-01 22:38:44 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <winrt/Windows.Media.h>
|
|
|
|
|
#include <winrt/Windows.Graphics.Imaging.h>
|
|
|
|
|
|
|
|
|
|
enum OutputBindingStrategy { Bound, Unbound, Empty };
|
|
|
|
|
enum EvaluationStrategy { Async, Sync };
|
|
|
|
|
enum ModelInputOutputType { Image, Tensor };
|
|
|
|
|
enum InputImageSource { FromVideoFrame, FromImageFeatureValue, FromCPUResource, FromGPUResource };
|
|
|
|
|
enum VideoFrameSource { FromSoftwareBitmap, FromDirect3DSurface, FromUnsupportedD3DSurface };
|
|
|
|
|
|
|
|
|
|
namespace ImageTestHelper
|
|
|
|
|
{
|
2020-04-17 13:18:54 +00:00
|
|
|
wgi::BitmapPixelFormat GetPixelFormat(const std::wstring& inputPixelFormat);
|
2020-04-01 22:38:44 +00:00
|
|
|
|
2020-04-17 13:18:54 +00:00
|
|
|
winml::TensorFloat LoadInputImageFromCPU(
|
|
|
|
|
wgi::SoftwareBitmap softwareBitmap,
|
2020-04-01 22:38:44 +00:00
|
|
|
const std::wstring& modelPixelFormat);
|
|
|
|
|
|
2020-04-17 13:18:54 +00:00
|
|
|
winml::TensorFloat LoadInputImageFromGPU(
|
|
|
|
|
wgi::SoftwareBitmap softwareBitmap,
|
2020-04-01 22:38:44 +00:00
|
|
|
const std::wstring& modelPixelFormat);
|
|
|
|
|
|
|
|
|
|
bool VerifyHelper(
|
2020-04-17 13:18:54 +00:00
|
|
|
wm::VideoFrame actual,
|
|
|
|
|
wm::VideoFrame expected);
|
2020-04-01 22:38:44 +00:00
|
|
|
|
|
|
|
|
}
|