NaimaAqeel commited on
Commit
f51b0f2
·
verified ·
1 Parent(s): db13d3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -36,5 +36,9 @@ if uploaded_file is not None:
36
  # Compress the image using Truncated SVD
37
  compressed_image = truncated_svd_compress(resized_image, k)
38
 
 
 
 
 
39
  # Display original and compressed images
40
- st.image([gray_image, compressed_image], caption=["Original", "Compressed"])
 
36
  # Compress the image using Truncated SVD
37
  compressed_image = truncated_svd_compress(resized_image, k)
38
 
39
+ # Normalize the images for display
40
+ gray_image_display = (resized_image - resized_image.min()) / (resized_image.max() - resized_image.min())
41
+ compressed_image_display = (compressed_image - compressed_image.min()) / (compressed_image.max() - compressed_image.min())
42
+
43
  # Display original and compressed images
44
+ st.image([gray_image_display, compressed_image_display], caption=["Original", "Compressed"], use_column_width=True)