nielsr HF staff commited on
Commit
13f2d41
1 Parent(s): 71aa97f

Update code example

Browse files
Files changed (1) hide show
  1. README.md +1 -1
README.md CHANGED
@@ -30,7 +30,7 @@ import requests
30
 
31
  # load image from the IAM database (actually this model is meant to be used on printed text)
32
  url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
33
- image = Image.open(requests.get(url, stream=True).raw)
34
 
35
  processor = TrOCRProcessor.from_pretrained('microsoft/trocr-large-printed')
36
  model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-large-printed')
 
30
 
31
  # load image from the IAM database (actually this model is meant to be used on printed text)
32
  url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
33
+ image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
34
 
35
  processor = TrOCRProcessor.from_pretrained('microsoft/trocr-large-printed')
36
  model = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-large-printed')