| 233 | } |
| 234 | |
| 235 | ImageBatchVarShape VarShapePillowResize(ImageBatchVarShape &input, const std::vector<std::tuple<int, int>> &outSizes, |
| 236 | NVCVInterpolationType interpolation, std::optional<Stream> pstream) |
| 237 | { |
| 238 | ImageBatchVarShape output = ImageBatchVarShape::Create(input.capacity()); |
| 239 | |
| 240 | if (static_cast<int32_t>(outSizes.size()) != input.numImages()) |
| 241 | { |
| 242 | throw std::runtime_error("Invalid outSizes passed"); |
| 243 | } |
| 244 | |
| 245 | for (int i = 0; i < input.numImages(); ++i) |
| 246 | { |
| 247 | nvcv::ImageFormat format = input[i].format(); |
| 248 | auto size = outSizes[i]; |
| 249 | auto image = Image::Create({std::get<0>(size), std::get<1>(size)}, format); |
| 250 | output.pushBack(image); |
| 251 | } |
| 252 | |
| 253 | return VarShapePillowResizeInto(output, input, interpolation, pstream); |
| 254 | } |
| 255 | |
| 256 | } // namespace |
| 257 | |