ajitrajasekharan's picture
Update app.py
3d64db0
raw
history blame
703 Bytes
import PIL
from PIL import ImageDraw
from PIL import Image
import streamlit as st
import os
os.system('pip install git+git://github.com/jaidedai/easyocr.git')
import easyocr
def load_image(image_file):
img = PIL.Image.open(image_file)
return img
uploaded_file = st.file_uploader("Upload Files",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))