open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.79k stars 639 forks source link

[Bug] The text recognition results of Abinet inferred by C++ are garbled #2821

Open a819411321 opened 3 months ago

a819411321 commented 3 months ago

Checklist

Describe the bug

1, Using python mmdeploy inference Abinet reuslt is true image 2, Using C++ mmdeploy inference Abinet result is false image `

include

include "mmdeploy/text_detector.hpp"

include "mmdeploy/text_recognizer.hpp"

include "utils/argparse.h"

include "utils/mediaio.h"

include "utils/visualize.h"

using mmdeploy::TextDetector; using mmdeploy::TextRecognizer;

int main() {

std::string device_name = "cuda";
//std::string det_model_path = "D:/workspace/mmlab/cpp_weight/Dbnet";
std::string reg_model_path = "D:/workspace/mmlab/cpp_weight/Abinet";
std::string image_path = "D:/1.jpg";
std::string result_path = "D:/result.jpg";
cv::Mat img = cv::imread(image_path);
if (img.empty()) {
    fprintf(stderr, "failed to load image: %s\n", image_path.c_str());
    return -1;
}
mmdeploy::Device device(device_name);
TextRecognizer recognizer{ mmdeploy::Model(reg_model_path), device };
TextRecognizer::Result texts = recognizer.Apply(img);
mmdeploy_text_recognition_t& text = texts[0];
printf_s("result %s\n", text.text);

return 0;

} ` My 1.jpg 1

Reproduction

C++ mmdeploy SDK inference textreg

Environment

mmdeploy-1.2.0-windows-amd64-cuda11.3

Error traceback

No response

xzh929 commented 1 week ago

same problem