Spaces:
Sleeping
Sleeping
wracell
commited on
Commit
·
9cd3fca
1
Parent(s):
4480055
modified app.py
Browse files
app.py
CHANGED
|
@@ -47,13 +47,13 @@ def main():
|
|
| 47 |
if uploaded_files:
|
| 48 |
for uploaded_file in uploaded_files:
|
| 49 |
image = Image.open(uploaded_file)
|
| 50 |
-
st.image(image, caption=f"Original Image - {uploaded_file.name}",
|
| 51 |
|
| 52 |
k = st.slider(f"Select number of colors (clusters) for {uploaded_file.name}", min_value=2, max_value=64, value=16)
|
| 53 |
|
| 54 |
if st.button(f"Compress {uploaded_file.name}"):
|
| 55 |
compressed_img = compress_image_kmeans(image, k)
|
| 56 |
-
st.image(compressed_img, caption=f"Compressed Image - {uploaded_file.name}",
|
| 57 |
|
| 58 |
st.markdown(get_image_download_link(compressed_img, filename=f"compressed_{uploaded_file.name}"), unsafe_allow_html=True)
|
| 59 |
|
|
|
|
| 47 |
if uploaded_files:
|
| 48 |
for uploaded_file in uploaded_files:
|
| 49 |
image = Image.open(uploaded_file)
|
| 50 |
+
st.image(image, caption=f"Original Image - {uploaded_file.name}", use_container_width=True)
|
| 51 |
|
| 52 |
k = st.slider(f"Select number of colors (clusters) for {uploaded_file.name}", min_value=2, max_value=64, value=16)
|
| 53 |
|
| 54 |
if st.button(f"Compress {uploaded_file.name}"):
|
| 55 |
compressed_img = compress_image_kmeans(image, k)
|
| 56 |
+
st.image(compressed_img, caption=f"Compressed Image - {uploaded_file.name}", use_container_width=True)
|
| 57 |
|
| 58 |
st.markdown(get_image_download_link(compressed_img, filename=f"compressed_{uploaded_file.name}"), unsafe_allow_html=True)
|
| 59 |
|