diff --git a/csrc/mmdeploy/preprocess/transform/tracer.cpp b/csrc/mmdeploy/preprocess/transform/tracer.cpp index 1178c9cd9..7d2b28752 100644 --- a/csrc/mmdeploy/preprocess/transform/tracer.cpp +++ b/csrc/mmdeploy/preprocess/transform/tracer.cpp @@ -25,14 +25,14 @@ void Tracer::PrepareImage(const std::string &color_type, bool to_float32, Tensor void Tracer::Resize(const std::string &mode, const std::vector &size, DataType dtype) { trans_.push_back(ResizeParam{dtype, size, mode}); state_.shape[1] = size[0]; - state_.shape[2] = size[2]; + state_.shape[2] = size[1]; } void Tracer::Pad(float pad_val, const std::vector &tlbr, const std::vector &size, DataType dtype) { trans_.push_back(PadParam{dtype, pad_val, tlbr, size}); state_.shape[1] = size[0]; - state_.shape[2] = size[2]; + state_.shape[2] = size[1]; } void Tracer::Normalize(const std::vector &mean, const std::vector &std, bool to_rgb, @@ -55,7 +55,7 @@ void Tracer::CenterCrop(const std::vector &tlbr, const std::vector &si DataType dtype) { trans_.push_back(CropParam{state_.dtype, tlbr, size}); state_.shape[1] = size[0]; - state_.shape[2] = size[2]; + state_.shape[2] = size[1]; } void Tracer::DefaultFormatBundle(bool to_float, DataType dtype) {