Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
)
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
|
|
|
| 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()
|