Update README.md
Browse files
README.md
CHANGED
@@ -38,8 +38,8 @@ import requests
|
|
38 |
# load image from the IAM database
|
39 |
url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
|
40 |
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
|
41 |
-
processor = TrOCRProcessor.from_pretrained('
|
42 |
-
model = VisionEncoderDecoderModel.from_pretrained('
|
43 |
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|
44 |
generated_ids = model.generate(pixel_values)
|
45 |
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
@@ -59,9 +59,6 @@ You can use the raw model for optical character recognition (OCR) on single text
|
|
59 |
|
60 |
This model was finetuned on [german_handwriting](https://huggingface.co/datasets/fhswf/german_handwriting).
|
61 |
|
62 |
-
### Training Procedure
|
63 |
-
|
64 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
65 |
|
66 |
|
67 |
## Evaluation
|
|
|
38 |
# load image from the IAM database
|
39 |
url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg'
|
40 |
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
|
41 |
+
processor = TrOCRProcessor.from_pretrained('fhswf/TrOCR_german_handwritten')
|
42 |
+
model = VisionEncoderDecoderModel.from_pretrained('fhswf/TrOCR_german_handwritten')
|
43 |
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|
44 |
generated_ids = model.generate(pixel_values)
|
45 |
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
|
|
59 |
|
60 |
This model was finetuned on [german_handwriting](https://huggingface.co/datasets/fhswf/german_handwriting).
|
61 |
|
|
|
|
|
|
|
62 |
|
63 |
|
64 |
## Evaluation
|