MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / ResizeVarShape

Function ResizeVarShape

python/mod_cvcuda/operators/OpResize.cpp:78–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78ImageBatchVarShape ResizeVarShape(ImageBatchVarShape &input, const std::vector<std::tuple<int, int>> &out_size,
79 NVCVInterpolationType interp, std::optional<Stream> pstream)
80{
81 if (input.numImages() != (int)out_size.size())
82 {
83 throw std::runtime_error("Number of input images must be equal to the number of elements in output size list ");
84 }
85
86 ImageBatchVarShape output = ImageBatchVarShape::Create(input.capacity());
87
88 for (int i = 0; i < input.numImages(); ++i)
89 {
90 nvcv::ImageFormat format = input[i].format();
91 auto size = out_size[i];
92 auto image = Image::Create({std::get<0>(size), std::get<1>(size)}, format);
93 output.pushBack(image);
94 }
95
96 return ResizeVarShapeInto(output, input, interp, pstream);
97}
98
99} // namespace
100

Callers

nothing calls this directly

Calls 6

ResizeVarShapeIntoFunction · 0.85
numImagesMethod · 0.45
sizeMethod · 0.45
capacityMethod · 0.45
formatMethod · 0.45
pushBackMethod · 0.45

Tested by

no test coverage detected