Skip to content

RK3588 OCR 内存泄露 #2609

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

Open
LDRain777 opened this issue Apr 9, 2025 · 0 comments
Open

RK3588 OCR 内存泄露 #2609

LDRain777 opened this issue Apr 9, 2025 · 0 comments
Assignees

Comments

@LDRain777
Copy link

LDRain777 commented Apr 9, 2025

在对生成的demo文件进行压力测试的时候,出现内存泄露问题.
infer.cc修改后的代码:

int processImages() {

  fastdeploy::RuntimeOption option;
  fastdeploy::ModelFormat format;
  int flag = std::atoi("1");

  if (flag == 0) {
    option.UseCpu();
    format = fastdeploy::ONNX;
  } else if (flag == 1) {
    option.UseRKNPU2();
    format = fastdeploy::RKNN;
  }

  std::string det_model_dir = "./yh/det4_shape_rk3588_unquantized.rknn";
  std::string cls_model_dir = "./yh/cls2_shape_rk3588_unquantized.rknn";
  std::string rec_model_dir = "./yh/rec4_shape_rk3588_unquantized.rknn";
  std::string rec_label_file = "./yh/ppocr_keys_v1.txt";
  std::string test_image = "./1.jpg";
  InitAndInfer(det_model_dir, cls_model_dir, rec_model_dir, rec_label_file,
               test_image, option, format);
  return 0;
}

测试test.cpp:

#include <iostream>
#include <vector>
#include <string>
#include "infer_demo.h" // 包含静态库的头文件

int main() {
    while(1) {
        processImages();
    }

    return 0;
}

头文件:infer_demo.h

#ifndef INFER_DEMO_H
#define INFER_DEMO_H

int processImages();

#endif // INFER_DEMO_H

Image

Image

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