Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
-
from st_clickable_images import clickable_images
|
3 |
|
|
|
|
|
4 |
clicked = clickable_images(
|
5 |
[
|
6 |
"https://images.unsplash.com/photo-1565130838609-c3a86655db61?w=700",
|
@@ -13,7 +14,6 @@ clicked = clickable_images(
|
|
13 |
div_style={"display": "flex", "justify-content": "center", "flex-wrap": "wrap"},
|
14 |
img_style={"margin": "5px", "height": "200px"},
|
15 |
)
|
16 |
-
|
17 |
st.markdown(f"Image #{clicked} clicked" if clicked > -1 else "No image clicked")
|
18 |
|
19 |
|
@@ -22,5 +22,28 @@ from streamlit_pills import pills
|
|
22 |
selected = pills("Label", ["Option 1", "Option 2", "Option 3"], ["π", "π", "π"])
|
23 |
st.write(selected)
|
24 |
|
|
|
|
|
25 |
st.markdown("")
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
|
|
2 |
|
3 |
+
|
4 |
+
from st_clickable_images import clickable_images
|
5 |
clicked = clickable_images(
|
6 |
[
|
7 |
"https://images.unsplash.com/photo-1565130838609-c3a86655db61?w=700",
|
|
|
14 |
div_style={"display": "flex", "justify-content": "center", "flex-wrap": "wrap"},
|
15 |
img_style={"margin": "5px", "height": "200px"},
|
16 |
)
|
|
|
17 |
st.markdown(f"Image #{clicked} clicked" if clicked > -1 else "No image clicked")
|
18 |
|
19 |
|
|
|
22 |
selected = pills("Label", ["Option 1", "Option 2", "Option 3"], ["π", "π", "π"])
|
23 |
st.write(selected)
|
24 |
|
25 |
+
|
26 |
+
|
27 |
st.markdown("")
|
28 |
|
29 |
+
|
30 |
+
|
31 |
+
import numpy as np
|
32 |
+
from array2gif import write_gif
|
33 |
+
|
34 |
+
dataset = [
|
35 |
+
np.array([
|
36 |
+
[[255, 0, 0], [255, 0, 0]], # red intensities
|
37 |
+
[[0, 255, 0], [0, 255, 0]], # green intensities
|
38 |
+
[[0, 0, 255], [0, 0, 255]] # blue intensities
|
39 |
+
]),
|
40 |
+
np.array([
|
41 |
+
[[0, 0, 255], [0, 0, 255]],
|
42 |
+
[[0, 255, 0], [0, 255, 0]],
|
43 |
+
[[255, 0, 0], [255, 0, 0]]
|
44 |
+
])
|
45 |
+
]
|
46 |
+
write_gif(dataset, 'rgbbgr.gif', fps=5)
|
47 |
+
|
48 |
+
# or for just a still GIF
|
49 |
+
write_gif(dataset[0], 'rgb.gif')
|