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

Function VarShapeHQResize

python/mod_cvcuda/operators/OpHQResize.cpp:467–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467ImageBatchVarShape VarShapeHQResize(ImageBatchVarShape &src, const std::vector<std::tuple<int, int>> &outShape,
468 std::optional<bool> antialias, const std::optional<Rois> &roi,
469 std::optional<NVCVInterpolationType> interpolation,
470 std::optional<NVCVInterpolationType> minInterpolation,
471 std::optional<NVCVInterpolationType> magInterpolation,
472 std::optional<Stream> pstream)
473{
474 ImageBatchVarShape out = ImageBatchVarShape::Create(src.capacity());
475
476 int32_t numOutSizes = outShape.size();
477 if (numOutSizes != src.numImages() && numOutSizes != 1)
478 {
479 throw std::runtime_error(
480 "The list of output shapes `out_size` must either contain a single shape to be used for all output images "
481 "or its length must match the number of input samples.");
482 }
483
484 for (int i = 0; i < src.numImages(); ++i)
485 {
486 auto size = outShape[numOutSizes == 1 ? 0 : i];
487 auto image = Image::Create({std::get<1>(size), std::get<0>(size)}, src[i].format());
488 out.pushBack(image);
489 }
490
491 return VarShapeHQResizeInto(out, src, antialias, roi, interpolation, minInterpolation, magInterpolation, pstream);
492}
493
494TensorBatch TensorBatchHQResizeInto(TensorBatch &dst, const TensorBatch &src, std::optional<bool> antialias,
495 const std::optional<Rois> &roi, std::optional<NVCVInterpolationType> interpolation,

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected