-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnb_1.qmd
53 lines (36 loc) · 1.01 KB
/
nb_1.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: "Quarto Basics"
format:
html:
code-fold: true
jupyter: python3
---
For visualize dataset of table image question, answering
```{python}
from itabqa import loader, objs
from plotly.offline import init_notebook_mode, iplot
from IPython.display import HTML, display
init_notebook_mode()
```
```{python}
# | label: fig-groundtruth
# | fig-cap: "val_table_image_7517__GPC__2013__page_55_split_0"
sample = loader.load_sample_from_id(
objs.DataSplit.VAL, "val_table_image_7673__DVA__2013__page_88_split_0"
)
sample.draw_image(show_bbox=True, show_text=True)
display(HTML(sample.to_html()))
```
```{python}
# | label: fig-predict
# | fig-cap: "96801_7518"
sample2 = loader.load_sample_tr_from_id(objs.DataSplit.VAL, "96801_7518")
sample.draw_image(show_bbox=True, show_text=True)
display(HTML(sample2.to_html()))
```
```{python}
# | label: fig-sample
# | fig-cap: "random sample"
samples = loader.load_samples(objs.DataSplit.VAL, head=2)
loader.print_sample(samples[1], n_questions=3, show_bbox=True)
```