Spaces:
Runtime error
Runtime error
Commit
·
a0ff030
1
Parent(s):
016a4eb
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import collections
|
|
11 |
from datasets import load_dataset
|
12 |
|
13 |
dataset_small = load_dataset("pierreguillou/DocLayNet-small")
|
14 |
-
dataset_base = load_dataset("pierreguillou/DocLayNet-base")
|
15 |
|
16 |
id2label = {idx:label for idx,label in enumerate(dataset_small["train"].features["categories"].feature.names)}
|
17 |
labels = [label for idx, label in id2label.items()]
|
@@ -243,12 +243,12 @@ with gr.Blocks(title="DocLayNet image viewer", css=".gradio-container") as demo:
|
|
243 |
gr.HTML("""
|
244 |
<div style="font-family:'Times New Roman', 'Serif'; font-size:26pt; font-weight:bold; text-align:center;"><h1>DocLayNet image viewer</h1></div>
|
245 |
<div style="margin-top: 20px"><p>(01/29/2023) This APP is an image viewer of the DocLayNet dataset.</p></div>
|
246 |
-
<div><p>It uses the
|
247 |
<div><p>Make your parameters selections and the output will show 2 images of a randomly selected PDF with annotated bounding boxes, one of paragraphs and the other of lines, and a table of texts with their labels.</p></div>
|
248 |
""")
|
249 |
with gr.Row():
|
250 |
with gr.Column():
|
251 |
-
dataset_name_gr = gr.Radio(
|
252 |
with gr.Column():
|
253 |
split_gr = gr.Dropdown(splits, value="all", label="Split")
|
254 |
with gr.Column():
|
|
|
11 |
from datasets import load_dataset
|
12 |
|
13 |
dataset_small = load_dataset("pierreguillou/DocLayNet-small")
|
14 |
+
#dataset_base = load_dataset("pierreguillou/DocLayNet-base")
|
15 |
|
16 |
id2label = {idx:label for idx,label in enumerate(dataset_small["train"].features["categories"].feature.names)}
|
17 |
labels = [label for idx, label in id2label.items()]
|
|
|
243 |
gr.HTML("""
|
244 |
<div style="font-family:'Times New Roman', 'Serif'; font-size:26pt; font-weight:bold; text-align:center;"><h1>DocLayNet image viewer</h1></div>
|
245 |
<div style="margin-top: 20px"><p>(01/29/2023) This APP is an image viewer of the DocLayNet dataset.</p></div>
|
246 |
+
<div><p>It uses the dataset <a style="text-decoration: none; border-bottom: #64b5f6 0.125em solid; color: #64b5f6" href="https://huggingface.co/datasets/pierreguillou/DocLayNet-small" target="_blank">DocLayNet small</a> (in the corresponding <a href="https://github.com/piegu/language-models/blob/master/DocLayNet_image_viewer_APP.ipynb" target="_blank">notebook</a>, it is possible to use the <a style="text-decoration: none; border-bottom: #64b5f6 0.125em solid; color: #64b5f6" style="text-decoration: none; border-bottom: #64b5f6 0.125em solid; color: #64b5f6" href="https://huggingface.co/datasets/pierreguillou/DocLayNet-base" target="_blank">DocLayNet base</a> as well the notebook is run in a system setup more powerful than Google Colab).</p></div>
|
247 |
<div><p>Make your parameters selections and the output will show 2 images of a randomly selected PDF with annotated bounding boxes, one of paragraphs and the other of lines, and a table of texts with their labels.</p></div>
|
248 |
""")
|
249 |
with gr.Row():
|
250 |
with gr.Column():
|
251 |
+
dataset_name_gr = gr.Radio(["small"], value="small", label="DocLayNet dataset")
|
252 |
with gr.Column():
|
253 |
split_gr = gr.Dropdown(splits, value="all", label="Split")
|
254 |
with gr.Column():
|