ImageTests are to test all kinds of scenarios that are related to images.
To make image related tests data driven and increase test code coverage.
| Table Name | Device | EvaluationStrategies | Models | Input Files | Output Binding Strategies | Input Image Sources | InputPixelFormats |
|---|---|---|---|---|---|---|---|
| Table Rows | GPU | Async | fns-candy_Bgr8_freeDimInput | fish_720.png | Bound | FromImageFeatureValue | Bgra8 |
| CPU | Sync | fns-candy_Bgr8 | fish_720_Gray.png | Unbound | FromVideoFrame | Rgba8 | |
| fns-candy_Rgb8 | FromCPUResource | Gray8 | |||||
| fns-candy_tensor | FromGPUResource |
Devices the Test uses.
* GPU
* CPU
The strategy to use during evalution.
Bound VideoFrame outputimage(BitmapPixelFormat::Rgba8, outputtensorshape.GetAt(3), outputtensorshape.GetAt(2)); ImageFeatureValue outputTensor = ImageFeatureValue::CreateFromVideoFrame(outputimage);
Unbound
Des: Currently, we are using four models, FNS-candy_Bgr8_freeDimInput, FNS-candy_Bgr8, FNS-candy_Rgb8, and FNS-candy_Tensor. We would try to get more models to cover the following listed cases.
BitmapPixelFormat
ColorSpaceGamma
NominalPixelRange
b. Model Input Output Type
* free dimension
* image : corresponding to ImageFeatureDescriptor
* tensor : corresponding to TensorFeatureDescriptor
c. Models we are using.
a. input image source
FromImageFeatureValue VideoFrame frame = VideoFrame::CreateWithSoftwareBitmap(softwareBitmap); VERIFY_NO_THROW(m_modelBinding.Bind(inputFeature.Current().Name(), frame));
FromVideoFrame VideoFrame frame = VideoFrame::CreateWithSoftwareBitmap(softwareBitmap); VERIFY_NO_THROW(m_modelBinding.Bind(inputFeature.Current().Name(), frame));
FromGPUResource
Bind input from GPU Resources as described in this PR
FromCPUResource
Bind input from GPU Resources as described in this PR
b. Multiple inputs (**TODO**)
1. test the case where 2 inputs requiring GPU processing are bound back to back forcing bind calls that potentially overlap GPU work from previous bind
2. Test models require multiple inputs
c. Bind with Property (**TODO**)
* If bind with Property, what properties should be tested? And how to make properties as parameters?
We could convert the input image to the following PixelFormats, and then used as input of model. The pixel format expected from model input can be different from the pixel format of real input. But WinML can handle the conversion between them.
Googletest's value parameterized tests are used.