RapidAI / RapidOCR

📄 Awesome OCR multiple programing languages toolkits based on ONNXRuntime, OpenVINO and PaddlePaddle.
https://rapidai.github.io/RapidOCRDocs
Apache License 2.0
3.13k stars 370 forks source link

Depend on `opencv-python-headless` instead of `opencv-python` #185

Closed mertalev closed 6 months ago

mertalev commented 6 months ago

问题描述 / Problem Description

I'm interested in using this library in an existing project, but the fact that it requires opencv-python causes issues: other dependencies that use cv2 require opencv-python-headless except this one, and installing both causes errors. I have to uninstall both opencv-python and opencv-python-headless and re-install opencv-python-headless afterwards.

运行环境 / Runtime Environment

See this Poetry lock file. It runs in a Docker container based on either Ubuntu 22.04 or Debian Bookworm.

复现代码 / Reproduction Code

N/A

可能解决方案 / Possible solutions

Requiring opencv-python-headless would solve the issue and have a nice side effect of using a smaller dependency.

SWHL commented 6 months ago

Glad you are using this package.

Judging from our daily use experience, most python packages that rely on opencv rely on the opencv-python library, not opencv-python-headless. If rapidocr_onnxruntime instead relies on the opencv-python-headless

library, I'm afraid you will face the same problem as you here.

mertalev commented 6 months ago

You're right, I don't think there's a solution that works for everyone here. Fortunately, the package is mainly used through Docker so uninstalling and reinstalling can be handled when building.