Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,11 @@ def process_image(input_image, resolution_choice):
|
|
63 |
input_image = resize_image(input_image, 768)
|
64 |
processing_resolution = None
|
65 |
else:
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
|
68 |
# 处理图像
|
69 |
pipe_out = pipe(
|
@@ -102,7 +106,7 @@ def create_gradio_interface():
|
|
102 |
value="768", # 默认选择原始分辨率
|
103 |
)
|
104 |
gr.Markdown(
|
105 |
-
"Select the resolution for processing the image. Higher resolution may take longer to process
|
106 |
)
|
107 |
submit_btn = gr.Button("Remove Reflection", variant="primary")
|
108 |
with gr.Column():
|
|
|
63 |
input_image = resize_image(input_image, 768)
|
64 |
processing_resolution = None
|
65 |
else:
|
66 |
+
if input_image.size[0] > 2560 or input_image.size[1] > 2560:
|
67 |
+
processing_resolution = 2560 # 限制最大分辨率
|
68 |
+
input_image = resize_image(input_image, 2560)
|
69 |
+
else:
|
70 |
+
processing_resolution = 0 # 使用原始分辨率
|
71 |
|
72 |
# 处理图像
|
73 |
pipe_out = pipe(
|
|
|
106 |
value="768", # 默认选择原始分辨率
|
107 |
)
|
108 |
gr.Markdown(
|
109 |
+
"Select the resolution for processing the image, 768 is recommended for faster processing and stable performance. Higher resolution may take longer to process, we restrict the maximum resolution to 2560."
|
110 |
)
|
111 |
submit_btn = gr.Button("Remove Reflection", variant="primary")
|
112 |
with gr.Column():
|