core icon indicating copy to clipboard operation
core copied to clipboard

Add documentation for installation on ARM platforms (missing opencv-python, opencv-python-headless)

Open stweil opened this issue 6 years ago • 6 comments

Installation on ARM is currently not possible because the required opencv-python is missing.

Test result on Ubuntu 18.04.3 LTS (GNU/Linux 4.9.140-tegra aarch64):

$ pip install ocrd
Collecting ocrd
  Using cached https://files.pythonhosted.org/packages/cd/e4/9f56fe9971e04e2e97d6ad27457d6a1c17d798de9c15fd3030f194beca24/ocrd-0.15.2-py3-none-any.whl
Requirement already satisfied: numpy in ./ocr-d/20190828/lib/python3.6/site-packages (from ocrd)
Collecting bagit>=1.7.0 (from ocrd)
  Using cached https://files.pythonhosted.org/packages/ee/11/7a7fa81c0d43fb4d449d418eba57fc6c77959754c5c2259a215152810555/bagit-1.7.0.tar.gz
Collecting jsonschema (from ocrd)
  Using cached https://files.pythonhosted.org/packages/54/48/f5f11003ceddcd4ad292d4d9b5677588e9169eef41f88e38b2888e7ec6c4/jsonschema-3.0.2-py2.py3-none-any.whl
Collecting click (from ocrd)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting Pillow>=5.3.0 (from ocrd)
  Using cached https://files.pythonhosted.org/packages/51/fe/18125dc680720e4c3086dd3f5f95d80057c41ab98326877fc7d3ff6d0ee5/Pillow-6.1.0.tar.gz
Collecting lxml (from ocrd)
  Using cached https://files.pythonhosted.org/packages/c4/43/3f1e7d742e2a7925be180b6af5e0f67d38de2f37560365ac1a0b9a04c015/lxml-4.4.1.tar.gz
Collecting requests (from ocrd)
  Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting Deprecated==1.2.0 (from ocrd)
  Using cached https://files.pythonhosted.org/packages/97/a0/6e855c4c232953febbc3f4e857cf1c8b150aa937b58d98969fae3eafe5fc/Deprecated-1.2.0-py2.py3-none-any.whl
Collecting Flask (from ocrd)
  Using cached https://files.pythonhosted.org/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl
Collecting pyyaml (from ocrd)
  Using cached https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz
Collecting opencv-python (from ocrd)
  Could not find a version that satisfies the requirement opencv-python (from ocrd) (from versions: )
No matching distribution found for opencv-python (from ocrd)

There is currently no opencv-python for ARM. Citing skvark/opencv-python:

Note that the wheel (especially manylinux) format does not currently support properly ARM architecture so there are no packages for ARM based platforms in PyPI.

stweil avatar Aug 29 '19 15:08 stweil

I would like to test OCR-D on a NVIDIA Jetson Nano.

stweil avatar Aug 29 '19 15:08 stweil

pip install ocrd

Have you tried with the latest version?

pip install ocrd==1.0.0b17

kba avatar Sep 03 '19 11:09 kba

That also has the same problem:

$ pip install ocrd==1.0.0b17
[...]
Collecting opencv-python-headless (from ocrd==1.0.0b17)
  Could not find a version that satisfies the requirement opencv-python-headless (from ocrd==1.0.0b17) (from versions: )
No matching distribution found for opencv-python-headless (from ocrd==1.0.0b17)

In the meantime I managed to build both missing packages locally using https://github.com/skvark/opencv-python, so there remains mainly some missing documentation how to handle that special case.

stweil avatar Sep 03 '19 11:09 stweil

@stweil @kba could we add this to the wiki of the ocr-d website?

EEngl52 avatar Apr 06 '20 15:04 EEngl52

It is: https://github.com/OCR-D/ocrd-website/wiki/OCR-D-Installation-on-NVIDIA-Jetson-Nano-and-Xavier though it doesn't currently explain that you have to build OpenCV yourself:

In the meantime I managed to build both missing packages locally using https://github.com/skvark/opencv-python, so there remains mainly some missing documentation how to handle that special case.

@stweil Care to add that to your article?

kba avatar Feb 03 '21 10:02 kba

I should document that, but don't have the time to do so currently.

stweil avatar Feb 03 '21 10:02 stweil

Is this still an issue when using ocrd_all with OpenCV built from source?

kba avatar Nov 21 '23 13:11 kba

It is not an issue for ARM based Apple computers with macOS or Linux where the required prebuilt OpenCV packages are available (tested just now with Python 3.11 and pip install ocrd).

The same test on CentOS 8 aarch64 with Python3.11 was partially successful, too. It could get the requrired opencv_python_headless, but failed while building a wheel for psutil. That was caused by the missing python3-devel package (which I cannot install because I only have normal user rights on that machine).

So to summarize, I think that time (with increasing demand for aarch64 based solutions) solved this issue.

stweil avatar Nov 21 '23 14:11 stweil