Spaces:
Sleeping
Sleeping
Commit
·
5eb76a8
1
Parent(s):
28b8faf
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def resize_and_overlay_image(input_image, reduction_percentage, shift_pixels, sh
|
|
48 |
background_img[y:y + new_height, x:x + new_width] = resized_img
|
49 |
|
50 |
# Return the resulting image as a NumPy array
|
51 |
-
return background_img
|
52 |
|
53 |
# Create the Gradio interface
|
54 |
iface = gr.Interface(
|
@@ -62,7 +62,7 @@ iface = gr.Interface(
|
|
62 |
gr.inputs.Slider(minimum=0, maximum=100, step=10, default=0, label="Crop Top (pixels)"),
|
63 |
gr.inputs.Slider(minimum=0, maximum=100, step=10, default=0, label="Crop Bottom (pixels)")
|
64 |
],
|
65 |
-
outputs=gr.outputs.Image(type="numpy", label="Result"),
|
66 |
title="Image Resizer",
|
67 |
description="Reduce the size of an image, overlay it on a colored background, shift it, and crop the top and/or bottom."
|
68 |
)
|
|
|
48 |
background_img[y:y + new_height, x:x + new_width] = resized_img
|
49 |
|
50 |
# Return the resulting image as a NumPy array
|
51 |
+
return background_img, f"Input Image Dimensions: {width}x{height}"
|
52 |
|
53 |
# Create the Gradio interface
|
54 |
iface = gr.Interface(
|
|
|
62 |
gr.inputs.Slider(minimum=0, maximum=100, step=10, default=0, label="Crop Top (pixels)"),
|
63 |
gr.inputs.Slider(minimum=0, maximum=100, step=10, default=0, label="Crop Bottom (pixels)")
|
64 |
],
|
65 |
+
outputs=[gr.outputs.Image(type="numpy", label="Result"), gr.outputs.Text(label="Image Info")],
|
66 |
title="Image Resizer",
|
67 |
description="Reduce the size of an image, overlay it on a colored background, shift it, and crop the top and/or bottom."
|
68 |
)
|