Update code example

This commit is contained in:
Niels Rogge 2021-12-06 17:59:36 +00:00 committed by huggingface-web
parent 71aa97f7f4
commit 13f2d41a16
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ import requests
# load image from the IAM database (actually this model is meant to be used on printed text) # load image from the IAM database (actually this model is meant to be used on printed text)
url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg' url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
image = Image.open(requests.get(url, stream=True).raw) image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
processor = TrOCRProcessor.from_pretrained('microsoft/trocr-large-printed') processor = TrOCRProcessor.from_pretrained('microsoft/trocr-large-printed')
model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-large-printed') model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-large-printed')