提交 e0dea23d 编写于 作者: J jack

fix ImageBlob clear bug

上级 1a1f8c81
......@@ -45,8 +45,6 @@ class ImageBlob {
std::vector<float> im_data_;
void clear() {
ori_im_size_.clear();
new_im_size_.clear();
im_size_before_resize_.clear();
reshape_order_.clear();
im_data_.clear();
......
......@@ -128,6 +128,7 @@ bool Model::preprocess(const std::vector<cv::Mat> &input_im_batch, std::vector<I
bool Model::predict(const cv::Mat& im, ClsResult* result) {
inputs_.clear();
result->clear();
if (type == "detector") {
std::cerr << "Loading model is a 'detector', DetResult should be passed to "
"function predict()!"
......@@ -224,6 +225,7 @@ bool Model::predict(const std::vector<cv::Mat> &im_batch, std::vector<ClsResult>
}
bool Model::predict(const cv::Mat& im, DetResult* result) {
inputs_.clear();
result->clear();
if (type == "classifier") {
std::cerr << "Loading model is a 'classifier', ClsResult should be passed "
......@@ -328,6 +330,9 @@ bool Model::predict(const cv::Mat& im, DetResult* result) {
}
bool Model::predict(const std::vector<cv::Mat> &im_batch, std::vector<DetResult> &result, int thread_num) {
for(auto &inputs: inputs_batch_) {
inputs.clear();
}
if (type == "classifier") {
std::cerr << "Loading model is a 'classifier', ClsResult should be passed "
"to function predict()!"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册