File size: 267 Bytes
5cb572e
e4d92c7
 
 
5cb572e
53f18c3
0337b0a
e4d92c7
 
 
0337b0a
4949214
aa94054
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
from PIL import Image
from pix2tex.cli import LatexOCR


def predict(img: Image.Image) -> str:
    global model
    return model(img)


model = LatexOCR()
iface = gr.Interface(fn=predict, inputs=gr.Image(type='pil'), outputs="text")
iface.launch()