From 99d037cd3eeddc02329a8e59175c03a9557e92fe Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Mon, 2 Aug 2021 21:02:01 +0800 Subject: [PATCH] add install doc of paddlepaddle and paddleocr --- ppstructure/README.md | 38 +++++++++++++++++++++++++++++++++++- ppstructure/README_ch.md | 42 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/ppstructure/README.md b/ppstructure/README.md index 1a7ec15e..1fb52707 100644 --- a/ppstructure/README.md +++ b/ppstructure/README.md @@ -4,11 +4,47 @@ PPStructure is an OCR toolkit for complex layout analysis. It can divide documen ## 1. Quick start ### install +**install PaddlePaddle2.0** + +```bash +pip3 install --upgrade pip + +# If you have cuda9 or cuda10 installed on your machine, please run the following command to install +python3 -m pip install paddlepaddle-gpu==2.0.0 -i https://mirror.baidu.com/pypi/simple + +# If you only have cpu on your machine, please run the following command to install + +python3 -m pip install paddlepaddle==2.0.0 -i https://mirror.baidu.com/pypi/simple + +For more version requirements, please refer to the instructions in the [installation document](https://www.paddlepaddle.org.cn/install/quick) . +``` + +**Clone PaddleOCR repo** + +```bash +# Recommend +git clone https://github.com/PaddlePaddle/PaddleOCR + +# If you cannot pull successfully due to network problems, you can also choose to use the code hosting on the cloud: +git clone https://gitee.com/paddlepaddle/PaddleOCR + +# Note: The cloud-hosting code may not be able to synchronize the update with this GitHub project in real time. There might be a delay of 3-5 days. Please give priority to the recommended method. +``` **install paddleocr** -ref to [paddleocr whl doc](../doc/doc_en/whl_en.md) +install by pypi +```bash +cd PaddleOCR +pip install "paddleocr>=2.2" # # Recommend to use version 2.2 +``` + +build own whl package and install +```bash +python3 setup.py bdist_wheel +pip3 install dist/paddleocr-x.x.x-py3-none-any.whl # x.x.x is the version of paddleocr +``` **install layoutparser** ```sh pip3 install -U premailer https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl diff --git a/ppstructure/README_ch.md b/ppstructure/README_ch.md index 709757d5..07a06f91 100644 --- a/ppstructure/README_ch.md +++ b/ppstructure/README_ch.md @@ -6,9 +6,47 @@ PaddleStructure是一个用于复杂版面分析的OCR工具包,其能够对 ### 1.1 安装 +**安装PaddlePaddle2.0** + +```bash +pip3 install --upgrade pip + +# 如果您的机器安装的是CUDA9或CUDA10,请运行以下命令安装 +python3 -m pip install paddlepaddle-gpu==2.0.0 -i https://mirror.baidu.com/pypi/simple + +# 如果您的机器是CPU,请运行以下命令安装 + +python3 -m pip install paddlepaddle==2.0.0 -i https://mirror.baidu.com/pypi/simple + +# 更多的版本需求,请参照[安装文档](https://www.paddlepaddle.org.cn/install/quick)中的说明进行操作。 +``` + +**克隆PaddleOCR repo代码** + +```bash +【推荐】git clone https://github.com/PaddlePaddle/PaddleOCR + +如果因为网络问题无法pull成功,也可选择使用码云上的托管: + +git clone https://gitee.com/paddlepaddle/PaddleOCR + +注:码云托管代码可能无法实时同步本github项目更新,存在3~5天延时,请优先使用推荐方式。 + +``` + **安装 paddleocr** -参考 [paddleocr whl文档](../doc/doc_ch/whl.md) +pip安装 +```bash +cd PaddleOCR +pip install "paddleocr>=2.0.1" # 推荐使用2.0.1+版本 +``` + +本地构建并安装 +```bash +python3 setup.py bdist_wheel +pip3 install dist/paddleocr-x.x.x-py3-none-any.whl # x.x.x是paddleocr的版本号 +``` **安装 layoutparser** ```sh @@ -106,7 +144,7 @@ Table OCR将表格图片转换为excel文档,其中包含对于表格文本的 使用如下命令即可完成预测引擎的推理 ```python -cd PaddleOCR/ppstructure +cd ppstructure # 下载模型 mkdir inference && cd inference -- GitLab