File size: 866 Bytes
0c830e5
 
50cf66b
0c830e5
b101525
d41195f
 
837c3d7
3d64db0
 
 
837c3d7
f65d837
5137c86
 
 
 
0c830e5
78ea23b
d41195f
9214c84
 
 
50cf66b
 
3d64db0
 
 
 
 
50cf66b
4352add
27e3c48
0c830e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import PIL 
from PIL import ImageDraw
from PIL import Image
import streamlit as st


display_area = st.empty()
display_area.text("Setting up environment. This will take some time...")
import os
os.system('pip install git+git://github.com/jaidedai/easyocr.git')
import easyocr
display_area.text("Env setup up Complete")

def load_image(image_file):
	img = PIL.Image.open(image_file)
	return img



uploaded_file = st.file_uploader("Choose image file to detect text",type=['png','jpeg','jpg'])
if uploaded_file is not None:
    file_details = {"FileName":uploaded_file.name,"FileType":uploaded_file.type,"FileSize":uploaded_file.size}
    st.write(file_details)
    image = load_image(uploaded_file)
    st.image(image,width=250)
    reader = easyocr.Reader(['en'],gpu=True)
    bound = reader.readtext(image)
    st.write(str(bound))