import gradio as gr import cv2 import easyocr def recognize_text(image): if image is not None: reader = easyocr.Reader(["ja"]) result = reader.readtext(image) ocr_text = "" for data in result: ocr_text += data[1] ocr_text += "_" return ocr_text iface = gr.Interface(fn=recognize_text, inputs="image", outputs="text") iface.launch()