keras-ocr
keras-ocr copied to clipboard
TypeError: annotate() missing 1 required positional argument: 's'
Hello, I have this error and I don't understand...
Looking for /root/.keras-ocr/craft_mlt_25k.h5 Looking for /root/.keras-ocr/crnn_kurapan.h5
TypeError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/keras_ocr/tools.py in drawAnnotations(image, predictions, ax) 182 color="r", 183 fontsize=14, --> 184 horizontalalignment="right" if side == "left" else "left", 185 186 )
TypeError: annotate() missing 1 required positional argument: 's'
Try updating matplotlib, the last version should not lead to this error
I'm working on Colab so i'm not supposed to make any down/update... I think...
But, I tried a LOT of modifications and nothing works... I'm trying to understand the error and analyzing the source code but i never found where and what is the 's' argument...
TypeError: annotate() missing 1 required positional argument: 's'
@docstring.dedent_interpd
def annotate(self, text, xy, *args, **kwargs):
a = mtext.Annotation(text, xy, *args, **kwargs)
a.set_transform(mtransforms.IdentityTransform())
if 'clip_on' in kwargs:
a.set_clip_path(self.patch)
self._add_text(a)
return a
annotate.__doc__ = mtext.Annotation.__init__.__doc__
#### Lines and spans
I guess there's a better solution to this, but i had the same problem on colab too and a
!pip install --upgrade matplotlib
solved it for me
@vittoema96 @faustomorales Thank you so much!! It solved it to me too.... But I have this other issue :
https://github.com/faustomorales/keras-ocr/issues/201
I'm working on it this morning and I hope to be able to fix it.
THX guys!!! So much!!!
I am getting same issue on colabs. How to use this function in colabs
def annotate(self, text, xy, *args, **kwargs): a = mtext.Annotation(text, xy, *args, **kwargs) a.set_transform(mtransforms.IdentityTransform()) if 'clip_on' in kwargs: a.set_clip_path(self.patch) self._add_text(a) return a annotate.doc = mtext.Annotation.init.doc