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>
|
|
|
|
|
|
2023-07-26 04:56:50 +00:00
|
|
|
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 {
|
|
|
|
|
wgi::BitmapPixelFormat GetPixelFormat(const std::wstring& inputPixelFormat);
|
|
|
|
|
|
|
|
|
|
winml::TensorFloat LoadInputImageFromCPU(wgi::SoftwareBitmap softwareBitmap, const std::wstring& modelPixelFormat);
|
|
|
|
|
|
|
|
|
|
winml::TensorFloat LoadInputImageFromGPU(wgi::SoftwareBitmap softwareBitmap, const std::wstring& modelPixelFormat);
|
|
|
|
|
|
|
|
|
|
bool VerifyHelper(wm::VideoFrame actual, wm::VideoFrame expected);
|
|
|
|
|
|
2023-08-15 03:50:14 +00:00
|
|
|
} // namespace ImageTestHelper
|