aryrk
commited on
Commit
·
95b14fb
1
Parent(s):
b79726b
[fix] make gradio live to prevent dropdown clear and validate preprocess_type
Browse files
app.py
CHANGED
|
@@ -39,6 +39,9 @@ def clear_session_files(session_id):
|
|
| 39 |
shutil.rmtree(session_dir)
|
| 40 |
|
| 41 |
def reflection_removal(input_image, preprocess_type="resize_and_crop"):
|
|
|
|
|
|
|
|
|
|
| 42 |
session_id = generate_session_id()
|
| 43 |
session_dir = os.path.join(UPLOAD_DIR, session_id)
|
| 44 |
upload_dir = os.path.join(session_dir, "uploads")
|
|
@@ -110,7 +113,8 @@ iface = gr.Interface(
|
|
| 110 |
for img in sample_images
|
| 111 |
],
|
| 112 |
title="Reflection Remover with Pix2Pix",
|
| 113 |
-
description="Upload images to remove reflections using a Pix2Pix model. You can also try the sample images below."
|
|
|
|
| 114 |
)
|
| 115 |
|
| 116 |
if __name__ == "__main__":
|
|
|
|
| 39 |
shutil.rmtree(session_dir)
|
| 40 |
|
| 41 |
def reflection_removal(input_image, preprocess_type="resize_and_crop"):
|
| 42 |
+
if preprocess_type == "":
|
| 43 |
+
preprocess_type = "resize_and_crop"
|
| 44 |
+
|
| 45 |
session_id = generate_session_id()
|
| 46 |
session_dir = os.path.join(UPLOAD_DIR, session_id)
|
| 47 |
upload_dir = os.path.join(session_dir, "uploads")
|
|
|
|
| 113 |
for img in sample_images
|
| 114 |
],
|
| 115 |
title="Reflection Remover with Pix2Pix",
|
| 116 |
+
description="Upload images to remove reflections using a Pix2Pix model. You can also try the sample images below.",
|
| 117 |
+
live=True
|
| 118 |
)
|
| 119 |
|
| 120 |
if __name__ == "__main__":
|