Spaces:
Sleeping
Sleeping
Synced repo using 'sync_with_huggingface' Github Action
Browse files- app.py +0 -23
- dataset_wrangler.py +12 -5
app.py
CHANGED
|
@@ -79,26 +79,3 @@ with st.container():
|
|
| 79 |
with cols[idx]:
|
| 80 |
st.image(iiif_url, use_container_width=True, caption=title)
|
| 81 |
st.image(pal_im, use_container_width=True, caption="Colour palette")
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
# # !
|
| 85 |
-
# import re
|
| 86 |
-
|
| 87 |
-
# df = dataset_wrangler.clean_df(dataset=dataset, subset=palette_columns)
|
| 88 |
-
|
| 89 |
-
# random_selection = df.sample(2)
|
| 90 |
-
|
| 91 |
-
# random_selection["iiif_url"] = random_selection["IE PID"].apply(
|
| 92 |
-
# lambda x: image_analysis.get_iiif_image_urls(x)
|
| 93 |
-
# )
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
# for ner in random_selection["ner"].values.tolist():
|
| 97 |
-
# print(ner)
|
| 98 |
-
|
| 99 |
-
# str_start = "→"
|
| 100 |
-
# str_end = " "
|
| 101 |
-
|
| 102 |
-
# res = re.findall(str_start + "(.*)" + str_end, ner)
|
| 103 |
-
|
| 104 |
-
# print(res)
|
|
|
|
| 79 |
with cols[idx]:
|
| 80 |
st.image(iiif_url, use_container_width=True, caption=title)
|
| 81 |
st.image(pal_im, use_container_width=True, caption="Colour palette")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_wrangler.py
CHANGED
|
@@ -116,15 +116,22 @@ def create_grid(df, palette_columns=["pal_1", "pal_3", "pal_5"]):
|
|
| 116 |
}
|
| 117 |
)
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
p = figure(sizing_mode="stretch_width", max_width=1000, tools=TOOLS)
|
| 120 |
p.grid.grid_line_color = None
|
| 121 |
p.axis.visible = False
|
| 122 |
hover = HoverTool(
|
| 123 |
-
tooltips=[
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
]
|
|
|
|
| 128 |
)
|
| 129 |
p.add_tools(hover)
|
| 130 |
|
|
|
|
| 116 |
}
|
| 117 |
)
|
| 118 |
|
| 119 |
+
tt = """
|
| 120 |
+
<div>
|
| 121 |
+
<a href=@viewer_link{safe}}>@viewer_link{safe}</a>
|
| 122 |
+
</div>
|
| 123 |
+
"""
|
| 124 |
+
|
| 125 |
p = figure(sizing_mode="stretch_width", max_width=1000, tools=TOOLS)
|
| 126 |
p.grid.grid_line_color = None
|
| 127 |
p.axis.visible = False
|
| 128 |
hover = HoverTool(
|
| 129 |
+
# tooltips=[
|
| 130 |
+
# ("Title", "@titles"),
|
| 131 |
+
# ("Date created", "@created"),
|
| 132 |
+
# ("SLV Viewer", "@viewer_link"),
|
| 133 |
+
# ]
|
| 134 |
+
tt
|
| 135 |
)
|
| 136 |
p.add_tools(hover)
|
| 137 |
|