Spaces:
Runtime error
Runtime error
| import easyocr | |
| import PIL | |
| from PIL import ImageDraw | |
| import streamlit as st | |
| reader = easyocr.Reader(['en']) | |
| url = 'https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg' | |
| img = Image.open(requests.get(url, stream=True).raw).convert("RGB") | |
| bound = reader.readtext(img) | |
| for i in range(len(bound)): | |
| bb = bound[i] | |
| left = bb[0][0][0] | |
| top = bb[0][0][1] | |
| right = bb[0][2][0] | |
| bottom = bb[0][2][1] | |
| st.text(f"bbox {left:.2f. right:.2f top:.2f bottom:.2f}") | |