Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,9 @@ def process_image(image, k):
|
|
14 |
"""Process the uploaded image, compress it using SVD, and return the result."""
|
15 |
# Convert PIL Image to NumPy array
|
16 |
image_np = np.array(image)
|
17 |
-
|
|
|
|
|
18 |
|
19 |
# Compress the image
|
20 |
compressed_image = svd_compress(gray_image, k)
|
|
|
14 |
"""Process the uploaded image, compress it using SVD, and return the result."""
|
15 |
# Convert PIL Image to NumPy array
|
16 |
image_np = np.array(image)
|
17 |
+
|
18 |
+
# Convert to grayscale
|
19 |
+
gray_image = color.rgb2gray(image_np)
|
20 |
|
21 |
# Compress the image
|
22 |
compressed_image = svd_compress(gray_image, k)
|