Spaces:
Running
on
Zero
Running
on
Zero
image sizing
Browse files
app.py
CHANGED
|
@@ -267,7 +267,7 @@ def advance_blur(input_image):
|
|
| 267 |
(255.0 * get_value_at_index(final_image, 0)[0].cpu().numpy()), 0, 255
|
| 268 |
).astype(np.uint8)
|
| 269 |
)
|
| 270 |
-
outpath = f"
|
| 271 |
img.save(outpath, quality=80, dpi=(72, 72))
|
| 272 |
return outpath
|
| 273 |
|
|
@@ -293,7 +293,7 @@ if __name__ == "__main__":
|
|
| 293 |
|
| 294 |
# with gr.Row():
|
| 295 |
# with gr.Column():
|
| 296 |
-
input_image = gr.Image(
|
| 297 |
generate_btn = gr.Button("Submit")
|
| 298 |
|
| 299 |
# with gr.Column():
|
|
@@ -303,6 +303,5 @@ if __name__ == "__main__":
|
|
| 303 |
# When clicking the button, it will trigger the `generate_image` function, with the respective inputs
|
| 304 |
# and the output an image
|
| 305 |
generate_btn.click(fn=advance_blur, inputs=[input_image], outputs=[input_image])
|
| 306 |
-
app.launch(share=True)
|
| 307 |
-
|
| 308 |
gr.Markdown('#### Have you even said "Thank you"?')
|
|
|
|
|
|
| 267 |
(255.0 * get_value_at_index(final_image, 0)[0].cpu().numpy()), 0, 255
|
| 268 |
).astype(np.uint8)
|
| 269 |
)
|
| 270 |
+
outpath = f"advance-blurred-{os.urandom(16).hex()}.jpg"
|
| 271 |
img.save(outpath, quality=80, dpi=(72, 72))
|
| 272 |
return outpath
|
| 273 |
|
|
|
|
| 293 |
|
| 294 |
# with gr.Row():
|
| 295 |
# with gr.Column():
|
| 296 |
+
input_image = gr.Image(type="filepath")
|
| 297 |
generate_btn = gr.Button("Submit")
|
| 298 |
|
| 299 |
# with gr.Column():
|
|
|
|
| 303 |
# When clicking the button, it will trigger the `generate_image` function, with the respective inputs
|
| 304 |
# and the output an image
|
| 305 |
generate_btn.click(fn=advance_blur, inputs=[input_image], outputs=[input_image])
|
|
|
|
|
|
|
| 306 |
gr.Markdown('#### Have you even said "Thank you"?')
|
| 307 |
+
app.launch(share=True)
|