pix2tex / app.py
Yiran
update app.py
4949214
raw
history blame contribute delete
267 Bytes
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()