当我尝试使用 python 文件运行以下代码时:
import os
os.environ['USEA-TF'] ='1'
from doctr.io import DocumentFile
from doctr.models import ocr_predictor
model = ocr_predictor(pretrained=True)
document = DocumentFile.from_images('IM.jpg')
result = model(document)
result.show(document)
json_response = result.export()
print(json_response)
出现此错误:-
ImportError: cannot import name 'OrderedDict' from 'typing' (c:\users\shubham nagar\appdata\local\programs\python\python37\lib\typing.py)
我如何才能在.py文件中运行
尝试下面的代码示例
from doctr.io import DocumentFile
from doctr.models import ocr_predictor
import json
model = ocr_predictor(det_arch = 'db_resnet50',
reco_arch = 'crnn_vgg16_bn',
pretrained = True)