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()