Spaces:
Sleeping
Sleeping
wjbmattingly
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -89,16 +89,21 @@ examples = [
|
|
89 |
]
|
90 |
|
91 |
# Gradio interface
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
)
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
iface.launch()
|
|
|
89 |
]
|
90 |
|
91 |
# Gradio interface
|
92 |
+
with gr.Blocks() as iface:
|
93 |
+
gr.Markdown("# Medieval TrOCR Model Switcher")
|
94 |
+
gr.Markdown("Upload an image of medieval text and select a model to transcribe it. Note: This tool is designed to work on a single line of text at a time for optimal results.")
|
95 |
+
|
96 |
+
with gr.Row():
|
97 |
+
with gr.Column(scale=2):
|
98 |
+
input_image = gr.Image(type="pil", label="Input Image")
|
99 |
+
with gr.Column(scale=1):
|
100 |
+
model_dropdown = gr.Dropdown(choices=list(MODEL_OPTIONS.keys()), label="Select Model", value="Medieval Base")
|
101 |
+
|
102 |
+
transcription_output = gr.Textbox(label="Transcription")
|
103 |
+
|
104 |
+
submit_button = gr.Button("Transcribe")
|
105 |
+
submit_button.click(fn=process_image, inputs=[input_image, model_dropdown], outputs=transcription_output)
|
106 |
+
|
107 |
+
gr.Examples(examples, inputs=[input_image, model_dropdown], outputs=transcription_output)
|
108 |
|
109 |
iface.launch()
|