abiabidali
commited on
Commit
•
856c08b
1
Parent(s):
845613a
Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,10 @@ def process_images(image_files, enhance, scale, adjust_dpi, dpi, resize, width,
|
|
94 |
for file_path in processed_images:
|
95 |
zipf.write(file_path, os.path.basename(file_path))
|
96 |
|
97 |
-
|
|
|
|
|
|
|
98 |
|
99 |
iface = gr.Interface(
|
100 |
fn=process_images,
|
@@ -109,7 +112,8 @@ iface = gr.Interface(
|
|
109 |
gr.Number(label="Height", value=512)
|
110 |
],
|
111 |
outputs=[
|
112 |
-
gr.
|
|
|
113 |
],
|
114 |
title="Multi-Image Enhancer",
|
115 |
description="Upload multiple images (.jpg, .png), enhance using AI, adjust DPI, resize, and download the final results as a ZIP file."
|
@@ -117,3 +121,4 @@ iface = gr.Interface(
|
|
117 |
|
118 |
iface.launch(debug=True)
|
119 |
|
|
|
|
94 |
for file_path in processed_images:
|
95 |
zipf.write(file_path, os.path.basename(file_path))
|
96 |
|
97 |
+
# Load images for display in the gallery
|
98 |
+
display_images = [Image.open(img_path) for img_path in processed_images]
|
99 |
+
|
100 |
+
return display_images, zip_path
|
101 |
|
102 |
iface = gr.Interface(
|
103 |
fn=process_images,
|
|
|
112 |
gr.Number(label="Height", value=512)
|
113 |
],
|
114 |
outputs=[
|
115 |
+
gr.Gallery(label="Final Images"), # Display the processed images
|
116 |
+
gr.File(label="Download Final Images (ZIP)") # Provide a ZIP file for download
|
117 |
],
|
118 |
title="Multi-Image Enhancer",
|
119 |
description="Upload multiple images (.jpg, .png), enhance using AI, adjust DPI, resize, and download the final results as a ZIP file."
|
|
|
121 |
|
122 |
iface.launch(debug=True)
|
123 |
|
124 |
+
|