import streamlit as st from PIL import Image st.title("Image to Text Converter") uploaded_image = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"]) if uploaded_image is not None: # Display the uploaded image image = Image.open(uploaded_image) st.image(image, caption='Uploaded Image.', use_column_width=True) # Extract text from the image st.write("Extracting text from the image...") # Display the extracted text st.text_area("Extracted Text", "desc", height=200) # Instructions for Tesseract OCR st.sidebar.title("Instructions") st.sidebar.write( """ 1. Upload an image using the file uploader. 2. Wait for the app to process and extract text from the image. 3. The extracted text will be displayed in the text area. """ )