hdeldar commited on
Commit
f1e5612
1 Parent(s): 1c7c08e

add message of resize

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -95,12 +95,13 @@ def main():
95
  image = Image.open(file) # read image with PIL library
96
  w, h = image.size
97
  if w > 600 or h > 400:
 
98
  image = image.resize((600, 400))
99
  st.image(image) #display
100
  holder.empty()
101
 
102
  # it will only detect the English and Turkish part of the image as text
103
- reader = easyocr.Reader(['fa','ar'], gpu=False) #, model_storage_directory='temp/',user_network_directory='temp/net'
104
  result = reader.readtext(np.array(image)) # turn image to numpy array
105
 
106
  # Add a placeholder
 
95
  image = Image.open(file) # read image with PIL library
96
  w, h = image.size
97
  if w > 600 or h > 400:
98
+ st.write("Due to the slowness of the server, the images were resized to 800x600.")
99
  image = image.resize((600, 400))
100
  st.image(image) #display
101
  holder.empty()
102
 
103
  # it will only detect the English and Turkish part of the image as text
104
+ reader = easyocr.Reader(['fa','ar'], gpu=True) #, model_storage_directory='temp/',user_network_directory='temp/net'
105
  result = reader.readtext(np.array(image)) # turn image to numpy array
106
 
107
  # Add a placeholder