Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,10 @@ def process_image(image, k):
|
|
35 |
# Convert compressed image back to PIL Image for Gradio output
|
36 |
compressed_image_pil = Image.fromarray(compressed_image)
|
37 |
|
|
|
|
|
|
|
|
|
38 |
return compressed_image_pil
|
39 |
|
40 |
# Gradio interface
|
@@ -50,4 +54,4 @@ gr_interface = gr.Interface(
|
|
50 |
)
|
51 |
|
52 |
# Launch the Gradio interface
|
53 |
-
gr_interface.launch()
|
|
|
35 |
# Convert compressed image back to PIL Image for Gradio output
|
36 |
compressed_image_pil = Image.fromarray(compressed_image)
|
37 |
|
38 |
+
# Ensure the PIL Image is in RGB mode for consistent display
|
39 |
+
if compressed_image_pil.mode != 'RGB':
|
40 |
+
compressed_image_pil = compressed_image_pil.convert('RGB')
|
41 |
+
|
42 |
return compressed_image_pil
|
43 |
|
44 |
# Gradio interface
|
|
|
54 |
)
|
55 |
|
56 |
# Launch the Gradio interface
|
57 |
+
gr_interface.launch()
|