parent
f19d70ac8c
commit
841c0d929f
@ -0,0 +1,4 @@
|
|||||||
|
conda activate py310
|
||||||
|
python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
|
||||||
|
|
||||||
|
pip install "paddleocr>=3.0.1"
|
@ -0,0 +1,7 @@
|
|||||||
|
import fitz # PyMuPDF
|
||||||
|
source=r'D:\BaiduNetdiskDownload\大数据研究苏轼\[047.中国古典文学基本丛书.苏轼词编年校注].王宗堂,邹同庆撰.扫描版.pdf'
|
||||||
|
pdf = fitz.open(source)
|
||||||
|
for page_num in range(len(pdf)):
|
||||||
|
page = pdf.load_page(page_num)
|
||||||
|
pix = page.get_pixmap(dpi=300)
|
||||||
|
pix.save(f"D:/usr/page_{page_num}.png")
|
Binary file not shown.
@ -0,0 +1,51 @@
|
|||||||
|
D:\anaconda3\envs\py310\python.exe D:\dsWork\QingLong\AI\Pdf\T2_AutoAll.py
|
||||||
|
Creating model: ('PP-LCNet_x1_0_doc_ori', None)
|
||||||
|
Using official model (PP-LCNet_x1_0_doc_ori), the model files will be automatically downloaded and saved in C:\Users\Administrator\.paddlex\official_models.
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "D:\dsWork\QingLong\AI\Pdf\T2_AutoAll.py", line 29, in <module>
|
||||||
|
pdf_to_text(source, target)
|
||||||
|
File "D:\dsWork\QingLong\AI\Pdf\T2_AutoAll.py", line 10, in pdf_to_text
|
||||||
|
ocr = PaddleOCR(use_textline_orientation=True, lang="ch", ocr_version='PP-OCRv3')
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddleocr\_pipelines\ocr.py", line 161, in __init__
|
||||||
|
super().__init__(**base_params)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddleocr\_pipelines\base.py", line 63, in __init__
|
||||||
|
self.paddlex_pipeline = self._create_paddlex_pipeline()
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddleocr\_pipelines\base.py", line 97, in _create_paddlex_pipeline
|
||||||
|
return create_pipeline(config=self._merged_paddlex_config, **kwargs)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\__init__.py", line 165, in create_pipeline
|
||||||
|
pipeline = BasePipeline.get(pipeline_name)(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\utils\deps.py", line 195, in _wrapper
|
||||||
|
return old_init_func(self, *args, **kwargs)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\_parallel.py", line 103, in __init__
|
||||||
|
self._pipeline = self._create_internal_pipeline(config, self.device)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\_parallel.py", line 158, in _create_internal_pipeline
|
||||||
|
return self._pipeline_cls(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\ocr\pipeline.py", line 73, in __init__
|
||||||
|
self.doc_preprocessor_pipeline = self.create_pipeline(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\base.py", line 140, in create_pipeline
|
||||||
|
pipeline = create_pipeline(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\__init__.py", line 165, in create_pipeline
|
||||||
|
pipeline = BasePipeline.get(pipeline_name)(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\utils\deps.py", line 195, in _wrapper
|
||||||
|
return old_init_func(self, *args, **kwargs)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\_parallel.py", line 103, in __init__
|
||||||
|
self._pipeline = self._create_internal_pipeline(config, self.device)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\_parallel.py", line 158, in _create_internal_pipeline
|
||||||
|
return self._pipeline_cls(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\doc_preprocessor\pipeline.py", line 67, in __init__
|
||||||
|
self.doc_ori_classify_model = self.create_model(doc_ori_classify_config)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\pipelines\base.py", line 107, in create_model
|
||||||
|
model = create_predictor(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\models\__init__.py", line 77, in create_predictor
|
||||||
|
return BasePredictor.get(model_name)(
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\models\image_classification\predictor.py", line 49, in __init__
|
||||||
|
self.preprocessors, self.infer, self.postprocessors = self._build()
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\models\image_classification\predictor.py", line 82, in _build
|
||||||
|
infer = self.create_static_infer()
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\models\base\predictor\base_predictor.py", line 240, in create_static_infer
|
||||||
|
return PaddleInfer(self.model_dir, self.MODEL_FILE_PREFIX, self._pp_option)
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\models\common\static_infer.py", line 274, in __init__
|
||||||
|
self.predictor = self._create()
|
||||||
|
File "D:\anaconda3\envs\py310\lib\site-packages\paddlex\inference\models\common\static_infer.py", line 360, in _create
|
||||||
|
config.set_optimization_level(3)
|
||||||
|
AttributeError: 'paddle.base.libpaddle.AnalysisConfig' object has no attribute 'set_optimization_level'. Did you mean: 'tensorrt_optimization_level'?
|
After Width: | Height: | Size: 1.2 MiB |
Loading…
Reference in new issue