Spaces:
Sleeping
Sleeping
wjbmattingly
commited on
Commit
•
e276afd
1
Parent(s):
c963155
Update app.py
Browse files
app.py
CHANGED
@@ -49,21 +49,18 @@ def process_image(image, model_name):
|
|
49 |
title = "Interactive demo: TrOCR Model Switcher"
|
50 |
description = "Demo for the Medieval TrOCR HTR Models."
|
51 |
|
52 |
-
examples = [
|
53 |
-
["https://huggingface.co/medieval-data/trocr-medieval-base/resolve/main/images/caroline-1.png", "Caroline"]
|
54 |
-
]
|
55 |
-
|
56 |
iface = gr.Interface(
|
57 |
fn=process_image,
|
58 |
inputs=[
|
59 |
-
gr.
|
60 |
-
gr.
|
61 |
],
|
62 |
-
outputs=gr.
|
63 |
title=title,
|
64 |
description=description,
|
65 |
-
|
66 |
-
|
|
|
67 |
)
|
68 |
|
69 |
iface.launch(debug=True)
|
|
|
49 |
title = "Interactive demo: TrOCR Model Switcher"
|
50 |
description = "Demo for the Medieval TrOCR HTR Models."
|
51 |
|
|
|
|
|
|
|
|
|
52 |
iface = gr.Interface(
|
53 |
fn=process_image,
|
54 |
inputs=[
|
55 |
+
gr.Image(type="pil"),
|
56 |
+
gr.Dropdown(choices=list(MODEL_OPTIONS.keys()), label="Select Model")
|
57 |
],
|
58 |
+
outputs=gr.Textbox(),
|
59 |
title=title,
|
60 |
description=description,
|
61 |
+
examples=[
|
62 |
+
["image_0.png", "Medieval Latin Caroline"]
|
63 |
+
]
|
64 |
)
|
65 |
|
66 |
iface.launch(debug=True)
|