wjbmattingly commited on
Commit
84b7c25
1 Parent(s): a631f2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -88,20 +88,30 @@ examples = [
88
  [f"{base_url}textualis-3.png", "Medieval Textualis"],
89
  ]
90
 
91
- # Custom CSS to make the image wider
92
  custom_css = """
93
- #image_upload {
 
 
 
 
 
 
94
  max-width: 100% !important;
95
  width: 100% !important;
96
  height: auto !important;
97
  }
98
- #image_upload > div:first-child {
99
  width: 100% !important;
100
  }
101
- #image_upload img {
102
  max-width: 100% !important;
103
  width: 100% !important;
104
  height: auto !important;
 
 
 
 
105
  }
106
  """
107
 
@@ -111,7 +121,7 @@ with gr.Blocks(css=custom_css) as iface:
111
  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.")
112
 
113
  with gr.Row():
114
- input_image = gr.Image(type="pil", label="Input Image", elem_id="image_upload")
115
  model_dropdown = gr.Dropdown(choices=list(MODEL_OPTIONS.keys()), label="Select Model", value="Medieval Base")
116
 
117
  transcription_output = gr.Textbox(label="Transcription")
@@ -119,6 +129,6 @@ with gr.Blocks(css=custom_css) as iface:
119
  submit_button = gr.Button("Transcribe")
120
  submit_button.click(fn=process_image, inputs=[input_image, model_dropdown], outputs=transcription_output)
121
 
122
- gr.Examples(examples, inputs=[input_image, model_dropdown], outputs=transcription_output)
123
 
124
  iface.launch()
 
88
  [f"{base_url}textualis-3.png", "Medieval Textualis"],
89
  ]
90
 
91
+ # Custom CSS to make all images wider
92
  custom_css = """
93
+ .container {
94
+ max-width: 100% !important;
95
+ width: 100% !important;
96
+ margin-left: auto !important;
97
+ margin-right: auto !important;
98
+ }
99
+ #image_upload, .image-container {
100
  max-width: 100% !important;
101
  width: 100% !important;
102
  height: auto !important;
103
  }
104
+ #image_upload > div:first-child, .image-container > div:first-child {
105
  width: 100% !important;
106
  }
107
+ #image_upload img, .image-container img {
108
  max-width: 100% !important;
109
  width: 100% !important;
110
  height: auto !important;
111
+ object-fit: contain !important;
112
+ }
113
+ .examples-table td {
114
+ min-width: 400px;
115
  }
116
  """
117
 
 
121
  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.")
122
 
123
  with gr.Row():
124
+ input_image = gr.Image(type="pil", label="Input Image", elem_id="image_upload", elem_classes="image-container")
125
  model_dropdown = gr.Dropdown(choices=list(MODEL_OPTIONS.keys()), label="Select Model", value="Medieval Base")
126
 
127
  transcription_output = gr.Textbox(label="Transcription")
 
129
  submit_button = gr.Button("Transcribe")
130
  submit_button.click(fn=process_image, inputs=[input_image, model_dropdown], outputs=transcription_output)
131
 
132
+ gr.Examples(examples, inputs=[input_image, model_dropdown], outputs=transcription_output, elem_classes="examples-table")
133
 
134
  iface.launch()