通过easyocr识别图片中的文字,功能实现,但有个警告不知道如何配置才能消除。请大佬指教。
代码:[Python] 纯文本查看 复制代码 import easyocr
print('开始')
reader = easyocr.Reader(['ch_sim', 'en'])
result = reader.readtext(r'D:\Files\python\img_to_str\img2.jpg', detail=0)
print(result)
警告:
[Python] 纯文本查看 复制代码 CUDA not available - defaulting to CPU. Note: This module is much faster with a GPU.
C:\Users\candy\AppData\Local\Programs\Python\Python310\lib\site-packages\torchvision\models\_utils.py:252: UserWarning: Accessing the model URLs via the internal dictionary of the module is deprecated since 0.13 and will be removed in 0.15. Please access them via the appropriate Weights Enum instead.
warnings.warn(
C:\Users\candy\AppData\Local\Programs\Python\Python310\lib\site-packages\torchvision\models\_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
warnings.warn(
C:\Users\candy\AppData\Local\Programs\Python\Python310\lib\site-packages\torchvision\models\_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=None`.
warnings.warn(msg)
截图:
|