Spaces:
Running
on
Zero
Running
on
Zero
viklofg
commited on
Commit
·
4846384
1
Parent(s):
5f891d2
Update styling of image input widget
Browse files- app/gradio_config.py +1 -9
- app/tabs/submit.py +58 -57
app/gradio_config.py
CHANGED
@@ -50,7 +50,7 @@ hr.region-divider {
|
|
50 |
margin-bottom: 0.5em;
|
51 |
}
|
52 |
|
53 |
-
.
|
54 |
background: none;
|
55 |
border: solid 1px;
|
56 |
border-color: var(--block-border-color);
|
@@ -120,12 +120,4 @@ height: auto !important;
|
|
120 |
display:block;
|
121 |
}
|
122 |
|
123 |
-
.image_tab {
|
124 |
-
background: var(--bg);
|
125 |
-
border: none;
|
126 |
-
}
|
127 |
-
|
128 |
-
.image_tabs {
|
129 |
-
background: var(--bg);
|
130 |
-
}
|
131 |
"""
|
|
|
50 |
margin-bottom: 0.5em;
|
51 |
}
|
52 |
|
53 |
+
.panel-with-border {
|
54 |
background: none;
|
55 |
border: solid 1px;
|
56 |
border-color: var(--block-border-color);
|
|
|
120 |
display:block;
|
121 |
}
|
122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
"""
|
app/tabs/submit.py
CHANGED
@@ -201,64 +201,65 @@ with gr.Blocks() as submit:
|
|
201 |
|
202 |
collection_submit_state = gr.State()
|
203 |
|
204 |
-
with gr.Group():
|
205 |
-
with gr.Row(equal_height=True):
|
206 |
-
with gr.Column(scale=2):
|
207 |
-
batch_image_gallery = gr.Gallery(
|
208 |
-
file_types=["image"],
|
209 |
-
label="Image to transcribe",
|
210 |
-
interactive=True,
|
211 |
-
object_fit="scale-down",
|
212 |
-
)
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
)
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
gr.Markdown("## Settings")
|
263 |
gr.Markdown(
|
264 |
"Select a pipeline that best matches your image. The pipeline determines the processing workflow optimized for different handwritten text recognition tasks. "
|
|
|
201 |
|
202 |
collection_submit_state = gr.State()
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
|
205 |
+
with gr.Row(equal_height=True):
|
206 |
+
with gr.Column(scale=2):
|
207 |
+
batch_image_gallery = gr.Gallery(
|
208 |
+
file_types=["image"],
|
209 |
+
label="Image to transcribe",
|
210 |
+
interactive=True,
|
211 |
+
object_fit="scale-down",
|
212 |
+
)
|
213 |
+
|
214 |
+
with gr.Column(scale=1, variant="panel", elem_classes="panel-with-border"):
|
215 |
+
with gr.Tabs():
|
216 |
+
with gr.Tab("Examples"):
|
217 |
+
examples = gr.Gallery(
|
218 |
+
all_example_images(),
|
219 |
+
show_label=False,
|
220 |
+
interactive=False,
|
221 |
+
allow_preview=False,
|
222 |
+
object_fit="scale-down",
|
223 |
+
min_width=250,
|
224 |
+
height="100%",
|
225 |
+
columns=4,
|
226 |
+
container=False,
|
227 |
+
)
|
228 |
+
|
229 |
+
with gr.Tab("Image ID"):
|
230 |
+
image_id = gr.Textbox(
|
231 |
+
label="Upload by image ID",
|
232 |
+
info=(
|
233 |
+
"Use any image from our digitized archives by pasting its image ID found in the "
|
234 |
+
"<a href='https://sok.riksarkivet.se/bildvisning/R0002231_00005' target='_blank'>image viewer</a>. "
|
235 |
+
"Press enter to submit."
|
236 |
+
),
|
237 |
+
placeholder="R0002231_00005",
|
238 |
+
)
|
239 |
+
|
240 |
+
with gr.Tab("IIIF Manifest"):
|
241 |
+
iiif_manifest_url = gr.Textbox(
|
242 |
+
label="IIIF Manifest",
|
243 |
+
info=(
|
244 |
+
"Use an image from a IIIF manifest by pasting a IIIF manifest URL. "
|
245 |
+
"Press enter to submit."
|
246 |
+
),
|
247 |
+
placeholder="",
|
248 |
+
)
|
249 |
+
iiif_gallery = gr.Gallery(
|
250 |
+
interactive=False,
|
251 |
+
columns=4,
|
252 |
+
allow_preview=False,
|
253 |
+
container=False,
|
254 |
+
show_label=False,
|
255 |
+
object_fit="scale-down",
|
256 |
+
)
|
257 |
+
|
258 |
+
with gr.Tab("URL"):
|
259 |
+
image_url = gr.Textbox(label="Image URL", info="Upload an image by pasting its URL.", placeholder="https://example.com/image.jpg")
|
260 |
+
|
261 |
+
|
262 |
+
with gr.Column(variant="panel", elem_classes="panel-with-border"):
|
263 |
gr.Markdown("## Settings")
|
264 |
gr.Markdown(
|
265 |
"Select a pipeline that best matches your image. The pipeline determines the processing workflow optimized for different handwritten text recognition tasks. "
|