2257396011

Results 19 comments of 2257396011

> 您好,我也有同样的需求和问题,我想要将识别的流程部署在线上服务器,使用gpu处理,本机只需要在需要时调用api即可,您有解决办法麻烦告诉我一下好吗 ok

> 您好,我也有同样的需求和问题,我想要将识别的流程部署在线服务器上,使用gpu处理,本机只需要在需要时调用api即可,您有解决方法麻烦告诉我一下好吗? 你可以先自己试着修改一下,主要是doc_analyze.....这个里边的doc_analyze函数,你需要把模型加载部分和pdf的导入部分分开,然后就是Pipe这个里边的程序,都需要修改。

> 有人解决了吗 我解决了,目前可以支持将加载和导入pdf分开了,但是只支持txt方式和ocr方式,那个auto必须在之前输入pdf来判断使用txt还是ocr所以不行

主程序代码改动: def pdf_parse_main( parse_method: str = 'ocr', is_json_md_dump: bool = True ): try: model_json = [] # 选择解析方式 if parse_method == "txt": pipe = TXTPipe(model_json) elif parse_method == "ocr": pipe...

ocrpipe代码: class OCRPipe(AbsPipe): def __init__(self, model_list: list, is_debug: bool = False): super().__init__(model_list, is_debug) def pipe_classify(self): pass def set_pdf(self, pdf_bytes: bytes): """设置 PDF 数据""" self.pdf_bytes = pdf_bytes def pipe_analyze(self): self.custom_model =...

txtpipe代码: class TXTPipe(AbsPipe): def __init__(self,model_list: list, is_debug: bool = False): super().__init__(model_list, is_debug) def pipe_classify(self): pass def set_pdf(self, pdf_bytes: bytes): """设置 PDF 数据""" self.pdf_bytes = pdf_bytes def pipe_analyze(self): self.custom_model = doc_analyze(ocr=False)...

abspipe代码: class AbsPipe(ABC): """ txt和ocr处理的抽象类 """ PIP_OCR = "ocr" PIP_TXT = "txt" def __init__(self, model_list: list, is_debug: bool = False): self.model_list = model_list self.pdf_mid_data = None # 未压缩 self.is_debug =...

在model_json为空的情况下使用

> > txtpipe代码: class TXTPipe(AbsPipe): > > ``` > > def __init__(self,model_list: list, is_debug: bool = False): > > super().__init__(model_list, is_debug) > > > > def pipe_classify(self): > > pass...

> > > > txtpipe代码: class TXTPipe(AbsPipe): > > > > ``` > > > > def __init__(self,model_list: list, is_debug: bool = False): > > > > super().__init__(model_list, is_debug) >...