未验证 提交 c4219c27 编写于 作者: C channings 提交者: GitHub

fix bug of image_shape of Resize is not define in yml (#1064)

上级 07baa6d3
......@@ -91,9 +91,11 @@ class Resize : public PreprocessOp {
arch_ = arch;
interp_ = item["interp"].as<int>();
max_size_ = item["max_size"].as<int>();
target_size_ = item["target_size"].as<int>();
if (item["image_shape"].IsDefined()) {
image_shape_ = item["image_shape"].as<std::vector<int>>();
}
}
target_size_ = item["target_size"].as<int>();
}
// Compute best resize scale for x-dimension, y-dimension
std::pair<float, float> GenerateScale(const cv::Mat& im);
......@@ -156,3 +158,4 @@ class Preprocessor {
};
} // namespace PaddleDetection
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册