Onur Savas commited on
Commit
c9dff95
1 Parent(s): 4b32f27

radio button choice

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -13,7 +13,7 @@ ocr_ar = PaddleOCR(use_angle_cls=True, lang='arabic')
13
  #ocr_ch = PaddleOCR(det_model_dir="models/det/ch/ch_PP-OCRv4_det_infer", rec_model_dir="models/rec/ch/ch_PP-OCRv4_rec_infer", cls_model_dir="models/cls/ch_ppocr_mobile_v2.0_cls_infer", rec_char_dict_path="models/dict/ppocr_keys_v1.txt", lang="ch")
14
 
15
 
16
- def perform_ocr(img):
17
 
18
  lang = "Russian"
19
  if lang == "English":
@@ -49,6 +49,6 @@ with demo:
49
  output_image = gr.Image()
50
  output_text = gr.Textbox(label="Results")
51
 
52
- input_button.click(fn=perform_ocr, inputs=[input_image], outputs=[output_image, output_text])
53
 
54
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
13
  #ocr_ch = PaddleOCR(det_model_dir="models/det/ch/ch_PP-OCRv4_det_infer", rec_model_dir="models/rec/ch/ch_PP-OCRv4_rec_infer", cls_model_dir="models/cls/ch_ppocr_mobile_v2.0_cls_infer", rec_char_dict_path="models/dict/ppocr_keys_v1.txt", lang="ch")
14
 
15
 
16
+ def perform_ocr(img, lang):
17
 
18
  lang = "Russian"
19
  if lang == "English":
 
49
  output_image = gr.Image()
50
  output_text = gr.Textbox(label="Results")
51
 
52
+ input_button.click(fn=perform_ocr, inputs=[input_image, input_radio], outputs=[output_image, output_text])
53
 
54
  demo.launch(server_name="0.0.0.0", server_port=7860)