kkatiz commited on
Commit
b56e2a8
1 Parent(s): 766443f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -1
README.md CHANGED
@@ -11,4 +11,21 @@ Vision Encoder Decoder Models
11
  - Use microsoft/trocr-base-handwritten as encoder.
12
  - Use airesearch/wangchanberta-base-att-spm-uncased as decoder
13
  - Fine-tune on 250k synthetic text images dataset using [ThaiGov V2 Corpus](https://github.com/PyThaiNLP/thaigov-v2-corpus)
14
- - It is useful to fine-tune any Thai OCR task.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  - Use microsoft/trocr-base-handwritten as encoder.
12
  - Use airesearch/wangchanberta-base-att-spm-uncased as decoder
13
  - Fine-tune on 250k synthetic text images dataset using [ThaiGov V2 Corpus](https://github.com/PyThaiNLP/thaigov-v2-corpus)
14
+ - Use [SynthTIGER](https://github.com/clovaai/synthtiger) to generate synthetic text image.
15
+ - It is useful to fine-tune any Thai OCR task.
16
+
17
+ # Usage
18
+
19
+ ```
20
+ from transformers import TrOCRProcessor, VisionEncoderDecoderModel
21
+
22
+ processor = TrOCRProcessor.from_pretrained("kkatiz/ocr-nithan")
23
+ model = VisionEncoderDecoderModel.from_pretrained("kkatiz/ocr-nithan")
24
+
25
+ image = Image.open(img_path).convert("RGB")
26
+ pixel_values = processor(image, return_tensors="pt").pixel_values
27
+ generated_ids = model.generate(pixel_values)
28
+
29
+ generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
30
+ print(generated_text)
31
+ ```