diff --git a/deploy/cpp/include/preprocess_op.h b/deploy/cpp/include/preprocess_op.h index bb2d0ca3eea6b58dc9ca064fb29cd3ea30acbb74..af672ea817cbf1f664fc0cc7cea2976d3b05a1e1 100644 --- a/deploy/cpp/include/preprocess_op.h +++ b/deploy/cpp/include/preprocess_op.h @@ -91,9 +91,11 @@ class Resize : public PreprocessOp { arch_ = arch; interp_ = item["interp"].as(); max_size_ = item["max_size"].as(); - target_size_ = item["target_size"].as(); + if (item["image_shape"].IsDefined()) { image_shape_ = item["image_shape"].as>(); - } + } + target_size_ = item["target_size"].as(); + } // Compute best resize scale for x-dimension, y-dimension std::pair GenerateScale(const cv::Mat& im); @@ -156,3 +158,4 @@ class Preprocessor { }; } // namespace PaddleDetection +