From 1751893bea9398b639e8a9fe0b24cf69bc703b36 Mon Sep 17 00:00:00 2001
From: WenmuZhou <572459439@qq.com>
Date: Fri, 21 Oct 2022 02:06:06 +0000
Subject: [PATCH] add recovery requirements to whl
---
paddleocr.py | 4 ++--
ppstructure/docs/quickstart.md | 6 ------
ppstructure/docs/quickstart_en.md | 6 ------
setup.py | 17 +++++++++++++----
4 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/paddleocr.py b/paddleocr.py
index 03c9ba18..61b5c536 100644
--- a/paddleocr.py
+++ b/paddleocr.py
@@ -47,7 +47,7 @@ __all__ = [
]
SUPPORT_DET_MODEL = ['DB']
-VERSION = '2.6.0.1'
+VERSION = '2.6.0.3'
SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']
BASE_DIR = os.path.expanduser("~/.paddleocr/")
@@ -681,7 +681,7 @@ def main():
"error in layout recovery image:{}, err msg: {}".format(
img_name, ex))
continue
-
+
for item in all_res:
item.pop('img')
item.pop('res')
diff --git a/ppstructure/docs/quickstart.md b/ppstructure/docs/quickstart.md
index f1f9cb8b..ad45c95a 100644
--- a/ppstructure/docs/quickstart.md
+++ b/ppstructure/docs/quickstart.md
@@ -49,12 +49,6 @@ pip3 install "paddleocr>=2.6"
# 安装 图像方向分类依赖包paddleclas(如不需要图像方向分类功能,可跳过)
pip3 install paddleclas>=2.4.3
-
-# 安装 关键信息抽取 依赖包(如不需要KIE功能,可跳过)
-pip3 install -r ppstructure/kie/requirements.txt
-
-# 安装 版面恢复 依赖包(如不需要版面恢复功能,可跳过)
-pip3 install -r ppstructure/recovery/requirements.txt
```
diff --git a/ppstructure/docs/quickstart_en.md b/ppstructure/docs/quickstart_en.md
index e0eec4b3..47a481f3 100644
--- a/ppstructure/docs/quickstart_en.md
+++ b/ppstructure/docs/quickstart_en.md
@@ -51,12 +51,6 @@ pip3 install "paddleocr>=2.6"
# Install the image direction classification dependency package paddleclas (if you do not use the image direction classification, you can skip it)
pip3 install paddleclas>=2.4.3
-
-# Install the KIE dependency packages (if you do not use the KIE, you can skip it)
-pip3 install -r kie/requirements.txt
-
-# Install the layout recovery dependency packages (if you do not use the layout recovery, you can skip it)
-pip3 install -r recovery/requirements.txt
```
diff --git a/setup.py b/setup.py
index 7d4d871d..54affbcf 100644
--- a/setup.py
+++ b/setup.py
@@ -16,9 +16,17 @@ from setuptools import setup
from io import open
from paddleocr import VERSION
-with open('requirements.txt', encoding="utf-8-sig") as f:
- requirements = f.readlines()
- requirements.append('tqdm')
+
+def load_requirements(file_list=None):
+ if file_list is None:
+ file_list = ['requirements.txt']
+ if isinstance(file_list, str):
+ file_list = [file_list]
+ requirements = []
+ for file in file_list:
+ with open(file, encoding="utf-8-sig") as f:
+ requirements.extend(f.readlines())
+ return requirements
def readme():
@@ -34,7 +42,8 @@ setup(
include_package_data=True,
entry_points={"console_scripts": ["paddleocr= paddleocr.paddleocr:main"]},
version=VERSION,
- install_requires=requirements,
+ install_requires=load_requirements(
+ ['requirements.txt', 'ppstructure/recovery/requirements.txt']),
license='Apache License 2.0',
description='Awesome OCR toolkits based on PaddlePaddle (8.6M ultra-lightweight pre-trained model, support training and deployment among server, mobile, embeded and IoT devices',
long_description=readme(),
--
GitLab