File size: 378 Bytes
7816ee0
4738281
557c49a
7816ee0
4a8c440
59a1148
 
96bf75c
557c49a
 
 
 
 
7816ee0
4a8c440
28ddd15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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()