PaddleOCR/doc/doc_en/installation_en.md

72 lines
3.3 KiB
Markdown
Raw Normal View History

2020-06-24 18:13:03 +08:00
## QUICK INSTALLATION
2020-06-08 10:16:26 +08:00
After testing, paddleocr can run on glibc 2.23. You can also test other glibc versions or install glic 2.23 for the best compatibility.
PaddleOCR working environment:
2020-12-15 16:53:27 +08:00
- PaddlePaddle 1.8+, Recommend PaddlePaddle 2.0rc1
2020-07-31 22:04:19 +08:00
- python3.7
2020-06-08 10:16:26 +08:00
- glibc 2.23
2020-07-17 13:45:10 +08:00
2020-10-13 17:49:16 +08:00
It is recommended to use the docker provided by us to run PaddleOCR, please refer to the use of docker [link](https://www.runoob.com/docker/docker-tutorial.html/).
2020-06-08 10:16:26 +08:00
2020-07-17 13:45:10 +08:00
*If you want to directly run the prediction code on mac or windows, you can start from step 2.*
2020-12-10 16:34:56 +08:00
**1. (Recommended) Prepare a docker environment. The first time you use this docker image, it will be downloaded automatically. Please be patient.**
2020-06-08 10:16:26 +08:00
```
# Switch to the working directory
cd /home/Projects
# You need to create a docker container for the first run, and do not need to run the current command when you run it again
# Create a docker container named ppocr and map the current directory to the /paddle directory of the container
2020-08-03 17:44:41 +08:00
#If using CPU, use docker instead of nvidia-docker to create docker
2020-12-10 16:34:56 +08:00
sudo docker run --name ppocr -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash
2020-06-08 10:16:26 +08:00
```
2020-12-10 16:34:56 +08:00
If using CUDA10, please run the following command to create a container.
It is recommended to set a shared memory greater than or equal to 32G through the --shm-size parameter:
2020-06-08 10:16:26 +08:00
```
2020-12-10 16:34:56 +08:00
sudo nvidia-docker run --name ppocr -v $PWD:/paddle --shm-size=64G --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash
2020-06-08 10:16:26 +08:00
```
You can also visit [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to get the image that fits your machine.
```
# ctrl+P+Q to exit docker, to re-enter docker using the following command:
sudo docker container exec -it ppocr /bin/bash
```
2020-10-13 17:49:16 +08:00
**2. Install PaddlePaddle Fluid v2.0**
2020-06-08 10:16:26 +08:00
```
pip3 install --upgrade pip
2020-10-13 17:49:16 +08:00
# If you have cuda9 or cuda10 installed on your machine, please run the following command to install
2020-12-15 16:53:27 +08:00
python3 -m pip install paddlepaddle-gpu==2.0rc1 -i https://mirror.baidu.com/pypi/simple
2020-07-17 13:45:10 +08:00
# If you only have cpu on your machine, please run the following command to install
2020-12-15 16:53:27 +08:00
python3 -m pip install paddlepaddle==2.0rc1 -i https://mirror.baidu.com/pypi/simple
2020-06-08 10:16:26 +08:00
```
For more software version requirements, please refer to the instructions in [Installation Document](https://www.paddlepaddle.org.cn/install/quick) for operation.
2020-08-11 20:23:27 +08:00
**3. Clone PaddleOCR repo**
2020-06-08 10:16:26 +08:00
```
# 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.
```
2020-08-11 20:23:27 +08:00
**4. Install third-party libraries**
2020-06-08 10:16:26 +08:00
```
cd PaddleOCR
pip3 install -r requirments.txt
```
2020-07-23 15:35:23 +08:00
If you getting this error `OSError: [WinError 126] The specified module could not be found` when you install shapely on windows.
Please try to download Shapely whl file using [http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely](http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely).
Reference: [Solve shapely installation on windows](https://stackoverflow.com/questions/44398265/install-shapely-oserror-winerror-126-the-specified-module-could-not-be-found)