|
import streamlit as st |
|
import easyocr |
|
from PIL import Image |
|
|
|
|
|
reader = easyocr.Reader(['en']) |
|
|
|
|
|
st.title("OCR with EasyOCR") |
|
|
|
|
|
uploaded_file = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"]) |
|
|
|
if uploaded_file: |
|
|
|
image = Image.open(uploaded_file) |
|
st.image(image, caption='Uploaded Image', use_column_width=True) |
|
|
|
|
|
result = reader.readtext(image) |
|
|
|
|
|
st.subheader("OCR Results:") |
|
for detection in result: |
|
text = detection[1] |
|
bbox = detection[0] |
|
st.write(f"Text: {text}") |
|
st.write(f"Bounding Box: {bbox}") |
|
|