hdeldar commited on
Commit
46919f7
1 Parent(s): d60645b

update app.py add rtl

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -6,6 +6,7 @@ import PIL
6
  from PIL import Image, ImageDraw
7
  from captcha.image import ImageCaptcha
8
  import random, string
 
9
 
10
  def rectangle(image, result):
11
  # https://www.blog.pythonlibrary.org/2021/02/23/drawing-shapes-on-images-with-python-and-pillow/
@@ -110,9 +111,12 @@ def main():
110
  # time.sleep(0.1)
111
 
112
  # print all predicted text:
113
- for idx in range(len(result)):
114
- pred_text = result[idx][1]
115
- st.write(pred_text)
 
 
 
116
 
117
  # collect the results in the dictionary:
118
  textdic_easyocr = {}
 
6
  from PIL import Image, ImageDraw
7
  from captcha.image import ImageCaptcha
8
  import random, string
9
+ import utlis
10
 
11
  def rectangle(image, result):
12
  # https://www.blog.pythonlibrary.org/2021/02/23/drawing-shapes-on-images-with-python-and-pillow/
 
111
  # time.sleep(0.1)
112
 
113
  # print all predicted text:
114
+ #for idx in range(len(result)):
115
+ # pred_text = result[idx][1]
116
+ # st.write(pred_text)
117
+
118
+ extracted_text = utlis.get_raw_text(result)
119
+ st.markdown('<p style="direction:rtl; text-align: right"> '+extracted_text+' </p>', unsafe_allow_html=True)
120
 
121
  # collect the results in the dictionary:
122
  textdic_easyocr = {}