Skip to content

📄 Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

Fix ocrweb requirements and update FAQ

SWHL573527477e6e
diff --git a/FAQ.md b/FAQ.md
index c20414b..fa5aab5 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -1,4 +1,10 @@
## 常见问题
+#### Q14: Linux部署python的程序时,import cv2,会报`ImportError: ligGL.so.1: cannot open shared object file: No such file or directory`?
+**A:**: [解决方法](https://stackoverflow.com/a/63978454/3335415
+) 有两个(来自群友ddeef):
+ 1. 安装`opencv-python-headless`取代`opencv-python`;
+ 2. 运行`sudo apt-get install -y libgl1-mesa-dev`
+
#### Q13: 询问下,我编译出来的进程在win7下面通过cmd调用,发生了崩溃的情况?
**A:**: 不支持win7 (by @如果我有時光機)
diff --git a/ocrweb/requirements.txt b/ocrweb/requirements.txt
index 6710795..bd053c4 100644
--- a/ocrweb/requirements.txt
+++ b/ocrweb/requirements.txt
@@ -4,4 +4,5 @@ six==1.15.0
pyclipper==1.2.1
numpy==1.19.1
Shapely==1.7.1
-Flask==1.1.2
\ No newline at end of file
+Flask==1.1.2
+Pillow
\ No newline at end of file
diff --git a/ocrweb/resources/ch_ppocr_mobile_v2_det/utils.py b/ocrweb/resources/ch_ppocr_mobile_v2_det/utils.py
index dfbea6c..048e762 100644
--- a/ocrweb/resources/ch_ppocr_mobile_v2_det/utils.py
+++ b/ocrweb/resources/ch_ppocr_mobile_v2_det/utils.py
@@ -25,6 +25,8 @@ import numpy as np
import pyclipper
import six
from shapely.geometry import Polygon
+ from PIL import Image
+
class DecodeImage(object):
@@ -77,7 +79,6 @@ class NormalizeImage(object):
def __call__(self, data):
img = data['image']
- from PIL import Image
if isinstance(img, Image.Image):
img = np.array(img)