add message of resize
Browse files
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=
|
| 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
|