Spaces:
Running
on
Zero
Running
on
Zero
viklofg
commited on
Commit
·
8fd3b0d
1
Parent(s):
5867a9c
Update instructions on the submit tab
Browse files- app/gradio_config.py +7 -0
- app/tabs/submit.py +28 -34
app/gradio_config.py
CHANGED
@@ -70,6 +70,13 @@ hr.region-divider {
|
|
70 |
color: var(--block-info-text-color);
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
.pipeline-help a {
|
74 |
color: var(--secondary-400);
|
75 |
}
|
|
|
70 |
color: var(--block-info-text-color);
|
71 |
}
|
72 |
|
73 |
+
.pipeline-info {
|
74 |
+
padding: 0 0 0 2px;
|
75 |
+
font-weight: var(--block-info-text-weight);
|
76 |
+
font-size: var(--block-info-text-size);
|
77 |
+
color: var(--block-info-text-color);
|
78 |
+
}
|
79 |
+
|
80 |
.pipeline-help a {
|
81 |
color: var(--secondary-400);
|
82 |
}
|
app/tabs/submit.py
CHANGED
@@ -175,13 +175,7 @@ def get_selected_example_pipeline(event: gr.SelectData) -> str | None:
|
|
175 |
|
176 |
with gr.Blocks() as submit:
|
177 |
gr.Markdown("# Upload")
|
178 |
-
gr.Markdown("
|
179 |
-
gr.Markdown(
|
180 |
-
"First you upload upload 1 image or multiple images (max 5 images). You can also use directly the Image ID from the National Archives of Sweden to request an image"
|
181 |
-
)
|
182 |
-
gr.Markdown(
|
183 |
-
"Afterward, choice a template from the examples based on your material. This will configure a certain pipeline that fits your image."
|
184 |
-
)
|
185 |
|
186 |
collection_submit_state = gr.State()
|
187 |
with gr.Group():
|
@@ -193,7 +187,6 @@ with gr.Blocks() as submit:
|
|
193 |
interactive=True,
|
194 |
object_fit="scale-down",
|
195 |
scale=3,
|
196 |
-
preview=True,
|
197 |
)
|
198 |
|
199 |
with gr.Column(scale=2):
|
@@ -214,6 +207,9 @@ with gr.Blocks() as submit:
|
|
214 |
|
215 |
iiif_image_placeholder = gr.Image(visible=False)
|
216 |
|
|
|
|
|
|
|
217 |
with gr.Column(variant="panel", elem_classes="pipeline-panel"):
|
218 |
gr.HTML("Pipeline", elem_classes="pipeline-header", padding=False)
|
219 |
|
@@ -226,35 +222,33 @@ with gr.Blocks() as submit:
|
|
226 |
scale=0,
|
227 |
elem_classes="pipeline-dropdown",
|
228 |
)
|
229 |
-
with gr.Column():
|
230 |
-
with gr.Row():
|
231 |
-
pipeline_description = gr.HTML(
|
232 |
-
value=get_pipeline_description,
|
233 |
-
inputs=pipeline_dropdown,
|
234 |
-
elem_classes="pipeline-description",
|
235 |
-
padding=False,
|
236 |
-
)
|
237 |
-
help_button = gr.Button(
|
238 |
-
"Edit Pipeline",
|
239 |
-
scale=0,
|
240 |
-
)
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
with gr.Row():
|
257 |
-
run_button = gr.Button("
|
258 |
progess_bar = gr.Textbox(visible=False, show_label=False)
|
259 |
|
260 |
@batch_image_gallery.upload(
|
|
|
175 |
|
176 |
with gr.Blocks() as submit:
|
177 |
gr.Markdown("# Upload")
|
178 |
+
gr.Markdown("Select or upload the image you want to transcribe. You can upload up to five images at a time.")
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
collection_submit_state = gr.State()
|
181 |
with gr.Group():
|
|
|
187 |
interactive=True,
|
188 |
object_fit="scale-down",
|
189 |
scale=3,
|
|
|
190 |
)
|
191 |
|
192 |
with gr.Column(scale=2):
|
|
|
207 |
|
208 |
iiif_image_placeholder = gr.Image(visible=False)
|
209 |
|
210 |
+
gr.Markdown("## Settings")
|
211 |
+
gr.Markdown("Select a pipeline that suits your image. You can edit the pipeline if you need to customize it further.")
|
212 |
+
|
213 |
with gr.Column(variant="panel", elem_classes="pipeline-panel"):
|
214 |
gr.HTML("Pipeline", elem_classes="pipeline-header", padding=False)
|
215 |
|
|
|
222 |
scale=0,
|
223 |
elem_classes="pipeline-dropdown",
|
224 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
+
with gr.Column():
|
227 |
+
help_button = gr.Button("Edit", scale=0)
|
228 |
+
|
229 |
+
pipeline_description = gr.HTML(
|
230 |
+
value=get_pipeline_description,
|
231 |
+
inputs=pipeline_dropdown,
|
232 |
+
elem_classes="pipeline-info",
|
233 |
+
padding=False,
|
234 |
+
)
|
235 |
+
|
236 |
+
with Modal(visible=False) as help_modal:
|
237 |
+
custom_template_yaml = gr.Code(
|
238 |
+
value=get_yaml,
|
239 |
+
inputs=pipeline_dropdown,
|
240 |
+
language="yaml",
|
241 |
+
container=False,
|
242 |
+
)
|
243 |
+
url = "https://ai-riksarkivet.github.io/htrflow/latest/getting_started/pipeline.html#example-pipelines"
|
244 |
+
gr.HTML(
|
245 |
+
f'See the <a href="{url}">documentation</a> for a detailed description on how to customize HTRflow pipelines.',
|
246 |
+
padding=False,
|
247 |
+
elem_classes="pipeline-help",
|
248 |
+
)
|
249 |
|
250 |
with gr.Row():
|
251 |
+
run_button = gr.Button("Transcribe", variant="primary", scale=0, min_width=200)
|
252 |
progess_bar = gr.Textbox(visible=False, show_label=False)
|
253 |
|
254 |
@batch_image_gallery.upload(
|