Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
a819411321 opened this issue Sep 2, 2024 · 1 comment
Open
3 tasks done

Comments

@a819411321
Copy link

Checklist

  • I have searched related issues but cannot get the expected help.
  • 2. I have read the FAQ documentation but cannot get the expected help.
  • 3. The bug has not been fixed in the latest version.

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
Copy link

xzh929 commented Nov 21, 2024

same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants