DerrylNessie commited on
Commit
d5653bd
1 Parent(s): ed65392

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,7 +9,7 @@ import cv2
9
  import math
10
  import numpy as np
11
 
12
- torch.hub.download_url_to_file('https://i.pinimg.com/originals/45/d0/30/45d03054e15f4be731781eecba7458a4.jpg', 'korean.png')
13
 
14
  def midpoint(x1, y1, x2, y2):
15
  x_mid = int((x1 + x2)/2)
@@ -68,15 +68,15 @@ def inference(img, lang):
68
  draw_mask(im, bounds)
69
  #remove_text(im, mask, bounds)
70
  lang = ""
71
- im.save('result.png')
72
  #mask.save('mask.png')
73
- return ['result.png', pd.DataFrame(bounds). iloc[: , 1:2]]
74
 
75
  title = 'EasyOCR'
76
  description = 'Gradio demo for EasyOCR. EasyOCR demo supports 80+ languages.To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to load them. Read more at the links below.'
77
  article = "<p style='text-align: center'><a href='https://www.jaided.ai/easyocr/'>Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.</a> | <a href='https://github.com/JaidedAI/EasyOCR'>Github Repo</a></p>"
78
  css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
79
- examples = [['korean.png',"korean"]]
80
  choices = [
81
  "chinese",
82
  "english",
 
9
  import math
10
  import numpy as np
11
 
12
+ torch.hub.download_url_to_file('https://i.pinimg.com/originals/45/d0/30/45d03054e15f4be731781eecba7458a4.jpg', 'korean.jpg')
13
 
14
  def midpoint(x1, y1, x2, y2):
15
  x_mid = int((x1 + x2)/2)
 
68
  draw_mask(im, bounds)
69
  #remove_text(im, mask, bounds)
70
  lang = ""
71
+ im.save('result.jpg')
72
  #mask.save('mask.png')
73
+ return ['result.jpg', pd.DataFrame(bounds). iloc[: , 1:2]]
74
 
75
  title = 'EasyOCR'
76
  description = 'Gradio demo for EasyOCR. EasyOCR demo supports 80+ languages.To use it, simply upload your image and choose a language from the dropdown menu, or click one of the examples to load them. Read more at the links below.'
77
  article = "<p style='text-align: center'><a href='https://www.jaided.ai/easyocr/'>Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.</a> | <a href='https://github.com/JaidedAI/EasyOCR'>Github Repo</a></p>"
78
  css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
79
+ examples = [['korean.jpg',"korean"]]
80
  choices = [
81
  "chinese",
82
  "english",