diff --git a/shared/api/image_transforms.hpp b/shared/api/image_transforms.hpp index da94bdfb..9016bacd 100644 --- a/shared/api/image_transforms.hpp +++ b/shared/api/image_transforms.hpp @@ -53,13 +53,15 @@ inline OrtxStatus convert_to_rgb(const ortc::Tensor& input, ortc::Tenso } struct Resize { - static const std::unordered_map InterpolationMethods() { - return { + static const std::unordered_map& InterpolationMethods() { + static std::unordered_map methods = { {"NEAREST", IMAGING_TRANSFORM_NEAREST}, {"LINEAR", IMAGING_TRANSFORM_BILINEAR}, {"CUBIC", IMAGING_TRANSFORM_BICUBIC}, {"LANCZOS", IMAGING_TRANSFORM_LANCZOS} }; + + return methods; } OrtxStatus Compute(const ortc::Tensor& input, ortc::Tensor& output) {