wjbmattingly commited on
Commit
ef086f3
·
verified ·
1 Parent(s): b8c6096

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -46,12 +46,15 @@ def phi_ocr(image):
46
  def process_image(input_image):
47
  return phi_ocr(input_image)
48
 
49
- iface = gr.Interface(
50
- fn=process_image,
51
- inputs=gr.Image(type="pil"),
52
- outputs="text",
53
- title="OCR with [TB-OCR-preview-0.1](https://huggingface.co/yifeihu/TB-OCR-preview-0.1)",
54
- description="Upload an image to extract and convert text to markdown format."
55
- )
 
 
 
56
 
57
- iface.launch()
 
46
  def process_image(input_image):
47
  return phi_ocr(input_image)
48
 
49
+ with gr.Blocks() as demo:
50
+ gr.Markdown("# OCR with TB-OCR-preview-0.1")
51
+ gr.Markdown("Upload an image to extract and convert text to markdown format.")
52
+ gr.Markdown("[Check out the model here](https://huggingface.co/yifeihu/TB-OCR-preview-0.1)")
53
+
54
+ input_image = gr.Image(type="pil")
55
+ output_text = gr.Textbox()
56
+
57
+ input_image.change(fn=process_image, inputs=input_image, outputs=output_text)
58
+
59
 
60
+ demo.launch()