iuliaturc / detextify

Remove text from AI-generated images
MIT License
243 stars 23 forks source link

Can't import PaddleTextDetector (on Mac) #10

Closed iuliaturc closed 1 year ago

iuliaturc commented 1 year ago

from detextify.text_detector import PaddleTextDetector Illegal instruction: 4

iuliaturc commented 1 year ago

I actually can't import any of the objects, so it's not PaddleTextDetector in particular. I suspect this will happen on any machine with no GPU.

iuliaturc commented 1 year ago

Hmm importing paddle also fails on a fresh install in a new virtual environment:

python3 -m venv throwaway
source throwaway/bin/activate
pip install paddlepaddle
pip install paddleocr

And then importing the library causes the same failure as above:

>>> from paddleocr import PaddleOCR
Illegal instruction: 4
iuliaturc commented 1 year ago

And that's because you need to install the right package depending on your platform x cuda installation, see docs.

For mac + CPU, the right incantation is the following:

pip install paddlepaddle==0.0.0 -f https://www.paddlepaddle.org.cn/whl/mac/cpu/develop.html
pip install paddleocr
iuliaturc commented 1 year ago

I can confirm that the latest version of detextify (0.2.1) works on a Mac, after manually installing the right version of paddle. We'll have to update the README with instructions on how to download paddle.