napatswift commited on
Commit
a158ece
·
verified ·
1 Parent(s): a4f0c21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -7,18 +7,17 @@ from huggingface_hub import from_pretrained_keras
7
  import numpy as np
8
  import gradio as gr
9
 
10
- max_length = 5
11
- img_width = 200
12
  img_height = 50
13
 
14
- model = from_pretrained_keras("keras-io/ocr-for-captcha", compile=False)
15
 
16
  prediction_model = keras.models.Model(
17
  model.get_layer(name="image").input, model.get_layer(name="dense2").output
18
  )
19
 
20
- with open("vocab.txt", "r") as f:
21
- vocab = f.read().splitlines()
22
 
23
  # Mapping integers back to original characters
24
  num_to_char = layers.StringLookup(
 
7
  import numpy as np
8
  import gradio as gr
9
 
10
+ max_length = 55
11
+ img_width = 240
12
  img_height = 50
13
 
14
+ model = from_pretrained_keras("napatswift/ocr-vl", compile=False)
15
 
16
  prediction_model = keras.models.Model(
17
  model.get_layer(name="image").input, model.get_layer(name="dense2").output
18
  )
19
 
20
+ vocab = ['(', ')', '+', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', '=', 'ก', 'ข', 'ค', 'ฆ', 'ง', 'จ', 'ฉ', 'ช', 'ซ', 'ฌ', 'ญ', 'ฎ', 'ฏ', 'ฐ', 'ฑ', 'ฒ', 'ณ', 'ด', 'ต', 'ถ', 'ท', 'ธ', 'น', 'บ', 'ป', 'ผ', 'ฝ', 'พ', 'ฟ', 'ภ', 'ม', 'ย', 'ร', 'ฤ', 'ล', 'ว', 'ศ', 'ษ', 'ส', 'ห', 'ฬ', 'อ', 'ฮ', 'ะ', 'ั', 'า', 'ำ', 'ิ', 'ี', 'ึ', 'ื', 'ุ', 'ู', 'เ', 'แ', 'โ', 'ใ', 'ไ', '็', '่', '้', '๊', '๋', '์', '๐', '๑', '๒', '๓', '๔', '๕', '๖', '๗', '๘', '๙']
 
21
 
22
  # Mapping integers back to original characters
23
  num_to_char = layers.StringLookup(