MCPcopy Create free account
hub / github.com/ARM-software/armnn / Resize

Method Resize

tests/InferenceTestImage.cpp:209–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209std::vector<float> InferenceTestImage::Resize(unsigned int newWidth,
210 unsigned int newHeight,
211 const armnn::CheckLocation& location,
212 const ResizingMethods meth,
213 const std::array<float, 3>& mean,
214 const std::array<float, 3>& stddev,
215 const float scale)
216{
217 std::vector<float> out;
218 if (newWidth == 0 || newHeight == 0)
219 {
220 throw InferenceTestImageResizeFailed(fmt::format("None of the dimensions passed to a resize "
221 "operation can be zero. Requested width: {0}. Requested height: {1}.", newWidth, newHeight));
222 }
223
224 switch (meth) {
225 case ResizingMethods::STB:
226 {
227 StbResize(*this, newWidth, newHeight);
228 break;
229 }
230 case ResizingMethods::BilinearAndNormalized:
231 {
232 out = ResizeBilinearAndNormalize(*this, newWidth, newHeight, scale, mean, stddev);
233 break;
234 }
235 default:
236 throw InferenceTestImageResizeFailed(fmt::format("Unknown resizing method asked ArmNN only"
237 " supports {STB, BilinearAndNormalized} {}",
238 location.AsString()));
239 }
240 return out;
241}
242
243void InferenceTestImage::Write(WriteFormat format, const char* filePath) const
244{

Callers 4

GetTestCaseDataMethod · 0.80
GetTestCaseDataMethod · 0.80

Calls 4

formatEnum · 0.85
AsStringMethod · 0.45

Tested by

no test coverage detected