Spaces:
Runtime error
Runtime error
File size: 1,495 Bytes
1454c13 3292a87 1454c13 ca33379 1c48c0f 3292a87 1c48c0f 3292a87 |
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 47 48 49 |
import streamlit as st
from st_clickable_images import clickable_images
clicked = clickable_images(
[
"https://images.unsplash.com/photo-1565130838609-c3a86655db61?w=700",
"https://images.unsplash.com/photo-1565372195458-9de0b320ef04?w=700",
"https://images.unsplash.com/photo-1582550945154-66ea8fff25e1?w=700",
"https://images.unsplash.com/photo-1591797442444-039f23ddcc14?w=700",
"https://images.unsplash.com/photo-1518727818782-ed5341dbd476?w=700",
],
titles=[f"Image #{str(i)}" for i in range(5)],
div_style={"display": "flex", "justify-content": "center", "flex-wrap": "wrap"},
img_style={"margin": "5px", "height": "200px"},
)
st.markdown(f"Image #{clicked} clicked" if clicked > -1 else "No image clicked")
from streamlit_pills import pills
selected = pills("Label", ["Option 1", "Option 2", "Option 3"], ["π", "π", "π"])
st.write(selected)
st.markdown("")
import numpy as np
from array2gif import write_gif
dataset = [
np.array([
[[255, 0, 0], [255, 0, 0]], # red intensities
[[0, 255, 0], [0, 255, 0]], # green intensities
[[0, 0, 255], [0, 0, 255]] # blue intensities
]),
np.array([
[[0, 0, 255], [0, 0, 255]],
[[0, 255, 0], [0, 255, 0]],
[[255, 0, 0], [255, 0, 0]]
])
]
write_gif(dataset, 'rgbbgr.gif', fps=5)
# or for just a still GIF
write_gif(dataset[0], 'rgb.gif') |