FastDeploy icon indicating copy to clipboard operation
FastDeploy copied to clipboard

deploying ppocr_v2 with only recognition model

Open saeedkhanehgir opened this issue 3 years ago • 3 comments

Hi Thanks for sharing this project. I want to change ppocr_v2 to get only the recognition model (for conditions where we have another detection model such as Yolo and I would like to use only the recognition ppocr model). I am working on the 0.7.0 release. I use this instruction for this work. According to this instruction, I modified ppocr_v2.h and ppocr_v2.cc to ppocr_v4.h and ppocr_v4.cc ( arbitary name) I put these two file in .../FastDeploy/fastdeploy/vision/ocr address. then I add #include "fastdeploy/vision/ocr/ppocr/ppocr_v4.h" to vision.h. then I changed ppocr_pybind.cc file in .../FastDeploy/fastdeploy/vision/ocr/ppocr address and ocr_pybind.cc file in .../fastdeploy/vision/ocr. My changed and modified files:

ppocr_v4.cc.txt ppocr_v4.h.txt ppocr_pybind.cc.txt ocr_pybind.cc.txt

My infer.cc and sample image are:

infer.cc.txt

1

when I want to compile infer.cc I get the bellow error : Screenshot from 2022-11-22 16-15-10

saeedkhanehgir avatar Nov 22 '22 12:11 saeedkhanehgir

Refer to this line of code, add a declaration before PPOCRv4 https://github.com/PaddlePaddle/FastDeploy/blob/521ec87cf5f55190489059a07ad4c074563c1ace/fastdeploy/vision/ocr/ppocr/ppocr_v3.h#L26

jiangjiajun avatar Nov 22 '22 13:11 jiangjiajun

@jiangjiajun Unfortunately, I did not understand what to do. Can you be more specific?

saeedkhanehgir avatar Nov 22 '22 13:11 saeedkhanehgir

I think you are create a new class PPOCRv4 like this

class PPOCRv4 : PPOCRv2 {
...
...
};

But we need to add a declaration before the definition, like

class FASTDEPLOY_DECL PPOCRv4 : PPOCRv2 {
...
...
};

jiangjiajun avatar Nov 22 '22 13:11 jiangjiajun

此ISSUE由于一年未更新,将会关闭处理,如有需要,可再次更新打开。

jiangjiajun avatar Feb 06 '24 04:02 jiangjiajun