hasibzunair commited on
Commit
0507c14
Β·
1 Parent(s): 113ef27
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,8 +9,8 @@ from pix2tex import cli as pix2tex
9
  model = pix2tex.LatexOCR()
10
 
11
 
12
- def inference(input_image_path):
13
- img = Image.open(input_image_path)
14
  output = model(img)
15
  print("Model output:", output)
16
  return output
@@ -29,7 +29,7 @@ demo = gr.Interface(
29
  description=description,
30
  article=article,
31
  inputs=gr.inputs.Image(
32
- type="filepath", label="Input: Image of your equation you want to covert."
33
  ),
34
  outputs=gr.outputs.Textbox(type="text", label="Output: Converted LaTeX code."),
35
  examples=["./eqn1.png", "./eqn2.png", "./eqn3.png"],
 
9
  model = pix2tex.LatexOCR()
10
 
11
 
12
+ def inference(img):
13
+ #img = Image.open(input_image_path)
14
  output = model(img)
15
  print("Model output:", output)
16
  return output
 
29
  description=description,
30
  article=article,
31
  inputs=gr.inputs.Image(
32
+ type="pil", label="Input: Image of your equation you want to covert."
33
  ),
34
  outputs=gr.outputs.Textbox(type="text", label="Output: Converted LaTeX code."),
35
  examples=["./eqn1.png", "./eqn2.png", "./eqn3.png"],