Fix prefast issue in image transforms (#837)
* fix prefast issue in image transforms * Update image_transforms.hpp * Update image_transforms.hpp --------- Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com> Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
This commit is contained in:
Родитель
be5aa773e3
Коммит
5b7e3d4b8b
|
@ -53,13 +53,15 @@ inline OrtxStatus convert_to_rgb(const ortc::Tensor<uint8_t>& input, ortc::Tenso
|
|||
}
|
||||
|
||||
struct Resize {
|
||||
static const std::unordered_map<std::string, int> InterpolationMethods() {
|
||||
return {
|
||||
static const std::unordered_map<std::string, int>& InterpolationMethods() {
|
||||
static std::unordered_map<std::string, int> methods = {
|
||||
{"NEAREST", IMAGING_TRANSFORM_NEAREST},
|
||||
{"LINEAR", IMAGING_TRANSFORM_BILINEAR},
|
||||
{"CUBIC", IMAGING_TRANSFORM_BICUBIC},
|
||||
{"LANCZOS", IMAGING_TRANSFORM_LANCZOS}
|
||||
};
|
||||
|
||||
return methods;
|
||||
}
|
||||
|
||||
OrtxStatus Compute(const ortc::Tensor<uint8_t>& input, ortc::Tensor<uint8_t>& output) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче