faustomorales / keras-ocr

A packaged and flexible version of the CRAFT text detector and Keras CRNN recognition model.
https://keras-ocr.readthedocs.io/
MIT License
1.39k stars 360 forks source link

annotate() missing 1 required positional argument: 's' #183

Closed JL-plusUltra closed 2 years ago

JL-plusUltra commented 2 years ago

I used the fixed annotated() version where s=text for an old project I had, but I still get the error that one positional argument is missing. The code works to extract text from one image, but the error stops it from getting the rest. Any help and suggestions would be awesome. Thanks! Here is a pic: c1

OmarMohamedHamed commented 2 years ago

I have got the same error, have you solved this problem ?

jjb21 commented 2 years ago

's' is a deprecated synonym for the 'text' parameter that is used in the keras_ocr.tools.drawAnnotations () funtion.

shayeny commented 2 years ago

Facing the same issue. Is there a fix planned for this ?

faustomorales commented 2 years ago

If you're getting annotate() missing 1 required positional argument: 's', it means you are on an old version of matplotlib because the parameter changed from s to text in matplotlib v3.3.0.

To fix this, you have two options:

FatmAhmedM commented 2 years ago

@faustomorales thanks,that was helpful

shayeny commented 2 years ago

Worked like a charm! Thanks @faustomorales

ebayo commented 2 years ago

The change from s to text seems to have been revoked in newer versions.

I got the error stated in the issue using matplotlib==3.2.2

It work well when I downgraded to matplotlib==3.0.0

mrdbourke commented 2 years ago

Using Google Colab (as of August 16 2022):

On my local machine: