Upload README.md
Browse files
README.md
CHANGED
@@ -11,11 +11,11 @@ The model is trained to recognize printed texts in Old Russian language
|
|
11 |
### Base-usage
|
12 |
```python
|
13 |
from PIL import Image
|
14 |
-
from transformers import VisionEncoderDecoderModel
|
15 |
|
16 |
hf_model = VisionEncoderDecoderModel.from_pretrained("Serovvans/trocr-old-russian")
|
17 |
|
18 |
-
image = Image.open("./path/to/
|
19 |
|
20 |
processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-printed")
|
21 |
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|
|
|
11 |
### Base-usage
|
12 |
```python
|
13 |
from PIL import Image
|
14 |
+
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
|
15 |
|
16 |
hf_model = VisionEncoderDecoderModel.from_pretrained("Serovvans/trocr-old-russian")
|
17 |
|
18 |
+
image = Image.open("./path/to/your/image")
|
19 |
|
20 |
processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-printed")
|
21 |
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|