Spaces:
Sleeping
Sleeping
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ import dataset_wrangler, image_analysis
|
|
4 |
|
5 |
dataset = "https://raw.githubusercontent.com/StateLibraryVictoria/public-domain-hack-2024/refs/heads/ch4-data-viz/datasets/ch3_colour_data_viz_suggestions_set_2_augmented.csv"
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
|
11 |
palette_columns = ["pal_1", "pal_3", "pal_5"]
|
12 |
|
@@ -30,9 +30,6 @@ with st.form("my_form"):
|
|
30 |
)
|
31 |
st.form_submit_button("Visualise my selection")
|
32 |
|
33 |
-
st.write(f"Min: {min_year} Max: {max_year}")
|
34 |
-
st.write(f"Min val: {values[0]} Max val: {values[1]}")
|
35 |
-
|
36 |
df = df[df["created_year"].between(values[0], values[1])]
|
37 |
|
38 |
random_selection = df.sample(n=3)
|
@@ -41,10 +38,16 @@ random_selection["iiif_url"] = random_selection["IE PID"].apply(
|
|
41 |
lambda x: image_analysis.get_iiif_image_urls(x)
|
42 |
)
|
43 |
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
46 |
|
47 |
|
48 |
p = dataset_wrangler.create_grid(df)
|
49 |
|
50 |
-
|
|
|
|
|
|
4 |
|
5 |
dataset = "https://raw.githubusercontent.com/StateLibraryVictoria/public-domain-hack-2024/refs/heads/ch4-data-viz/datasets/ch3_colour_data_viz_suggestions_set_2_augmented.csv"
|
6 |
|
7 |
+
st.write(
|
8 |
+
"Scrambled Images from [https://www.slv.vic.gov.au/images](https://www.slv.vic.gov.au/images)"
|
9 |
+
)
|
10 |
|
11 |
palette_columns = ["pal_1", "pal_3", "pal_5"]
|
12 |
|
|
|
30 |
)
|
31 |
st.form_submit_button("Visualise my selection")
|
32 |
|
|
|
|
|
|
|
33 |
df = df[df["created_year"].between(values[0], values[1])]
|
34 |
|
35 |
random_selection = df.sample(n=3)
|
|
|
38 |
lambda x: image_analysis.get_iiif_image_urls(x)
|
39 |
)
|
40 |
|
41 |
+
col1, col2 = st.columns([0.3, 0.7])
|
42 |
+
|
43 |
+
with col1:
|
44 |
+
st.write(f"Random image selection")
|
45 |
+
for img in random_selection["iiif_url"].values.tolist():
|
46 |
+
st.image(img, use_container_width=True)
|
47 |
|
48 |
|
49 |
p = dataset_wrangler.create_grid(df)
|
50 |
|
51 |
+
with col2:
|
52 |
+
st.write(f"Plotting images from {values[0]} to {values[1]}")
|
53 |
+
st.bokeh_chart(p, use_container_width=True)
|