Spaces:
Sleeping
Sleeping
Synced repo using 'sync_with_huggingface' Github Action
Browse files- __pycache__/image_analysis.cpython-311.pyc +0 -0
- app.py +8 -4
__pycache__/image_analysis.cpython-311.pyc
CHANGED
Binary files a/__pycache__/image_analysis.cpython-311.pyc and b/__pycache__/image_analysis.cpython-311.pyc differ
|
|
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
import dataset_wrangler, image_analysis
|
4 |
|
@@ -42,6 +43,7 @@ random_selection["iiif_url"] = random_selection["IE PID"].apply(
|
|
42 |
col1, col2 = st.columns([0.3, 0.7])
|
43 |
|
44 |
with col1:
|
|
|
45 |
st.write(f"Random image selection")
|
46 |
# for img in random_selection["iiif_url"].values.tolist():
|
47 |
# st.image(img, use_container_width=True)
|
@@ -49,9 +51,9 @@ with col1:
|
|
49 |
iiif_url = img[-1][0]
|
50 |
title = img[2]
|
51 |
palette = image_analysis.get_colour_palette_iiif_image(iiif_url=iiif_url)
|
52 |
-
|
53 |
st.image(img, use_container_width=True, caption=title)
|
54 |
-
st.image(
|
55 |
|
56 |
|
57 |
p = dataset_wrangler.create_grid(df)
|
@@ -63,6 +65,8 @@ with col2:
|
|
63 |
|
64 |
# # !
|
65 |
|
|
|
|
|
66 |
# df = dataset_wrangler.clean_df(dataset=dataset, subset=palette_columns)
|
67 |
|
68 |
# random_selection = df.sample()
|
@@ -75,6 +79,6 @@ with col2:
|
|
75 |
# iiif_url = img[-1][0]
|
76 |
# title = img[2]
|
77 |
# palette = image_analysis.get_colour_palette_iiif_image(iiif_url=iiif_url)
|
78 |
-
|
79 |
# st.image(img, use_container_width=True, caption=title)
|
80 |
-
# st.image(
|
|
|
1 |
import streamlit as st
|
2 |
+
from PIL import Image
|
3 |
|
4 |
import dataset_wrangler, image_analysis
|
5 |
|
|
|
43 |
col1, col2 = st.columns([0.3, 0.7])
|
44 |
|
45 |
with col1:
|
46 |
+
|
47 |
st.write(f"Random image selection")
|
48 |
# for img in random_selection["iiif_url"].values.tolist():
|
49 |
# st.image(img, use_container_width=True)
|
|
|
51 |
iiif_url = img[-1][0]
|
52 |
title = img[2]
|
53 |
palette = image_analysis.get_colour_palette_iiif_image(iiif_url=iiif_url)
|
54 |
+
pal_im = Image.fromarray(palette, "RGB")
|
55 |
st.image(img, use_container_width=True, caption=title)
|
56 |
+
st.image(pal_im, use_container_width=True, caption="Colour palette")
|
57 |
|
58 |
|
59 |
p = dataset_wrangler.create_grid(df)
|
|
|
65 |
|
66 |
# # !
|
67 |
|
68 |
+
# from PIL import Image
|
69 |
+
|
70 |
# df = dataset_wrangler.clean_df(dataset=dataset, subset=palette_columns)
|
71 |
|
72 |
# random_selection = df.sample()
|
|
|
79 |
# iiif_url = img[-1][0]
|
80 |
# title = img[2]
|
81 |
# palette = image_analysis.get_colour_palette_iiif_image(iiif_url=iiif_url)
|
82 |
+
# pal_im = Image.fromarray(palette, "RGB")
|
83 |
# st.image(img, use_container_width=True, caption=title)
|
84 |
+
# st.image(pal_im, use_container_width=True)
|