File size: 602 Bytes
66edd4b
 
af67195
66edd4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import streamlit as st
from ocrFuncs import imgOCR_img2text
from PIL import Image

st.write("Upload an image and this app will scan it for text")
user_image_object = st.file_uploader("upload your image", type=['png', 'jpg'], accept_multiple_files=False)

if user_image_object is not None:
  st.image(user_image_object )
  
  
  user_image_name = "input_image.png"
  
  input_image = Image.open( user_image_object )
  input_image.save(user_image_name )

  outputText = imgOCR_img2text(user_image_name) #takes a filname as input since easyOCR takes filenames as input 
  
  st.write(outputText )