Spaces:
Sleeping
Sleeping
Download app.py from im-plabonn/Image-Text: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/im-plabonn/Image-Text/resolve/main/app.py
- Command line
-
hf download hf://spaces/im-plabonn/Image-Text/app.py
-
curl -L -o app.py https://huggingface.co/spaces/im-plabonn/Image-Text/resolve/main/app.py
643 Bytes
| import easyocr | |
| import gradio as gr | |
| from PIL import Image | |
| # OCR Reader initialize kora (English language-er jonno) | |
| reader = easyocr.Reader(['en']) | |
| def image_to_text(input_img): | |
| # Image theke text extract kora | |
| results = reader.readtext(input_img, detail=0) | |
| # List-ke ekta string-e convert kora | |
| return "\n".join(results) | |
| # Gradio Interface design | |
| interface = gr.Interface( | |
| fn=image_to_text, | |
| inputs=gr.Image(type="pil"), | |
| outputs="text", | |
| title="Simple Image to Text Converter", | |
| description="Chobi upload korun ebong text niye nin!" | |
| ) | |
| if __name__ == "__main__": | |
| interface.launch() |