Spaces:
Runtime error
Runtime error
Rename pages/04_Super_Resolution.py to pages/04_图像放大.py
Browse files
pages/{04_Super_Resolution.py → 04_图像放大.py}
RENAMED
@@ -196,17 +196,17 @@ def save_image(image_file):
|
|
196 |
|
197 |
#------------
|
198 |
|
199 |
-
st.title("
|
200 |
# Saving uploaded image in input folder for processing
|
201 |
|
202 |
#with st.expander("Options/Parameters"):
|
203 |
|
204 |
input_img = st.file_uploader(
|
205 |
-
"
|
206 |
#save_image(input_img)
|
207 |
|
208 |
model_name = st.selectbox(
|
209 |
-
"Real-ESRGAN
|
210 |
["RealESRGAN_x4plus", "RealESRNet_x4plus", "RealESRGAN_x4plus_anime_6B", "RealESRGAN_x2plus", "realesr-general-x4v3"],
|
211 |
index=4
|
212 |
)
|
@@ -214,9 +214,9 @@ model_name = st.selectbox(
|
|
214 |
#denoise_strength = st.slider("Denoise Strength (Used only with the realesr-general-x4v3 model)", 0.0, 1.0, 0.5)
|
215 |
denoise_strength = 0.5
|
216 |
|
217 |
-
outscale = st.slider("
|
218 |
|
219 |
-
face_enhance = st.checkbox("
|
220 |
|
221 |
if input_img:
|
222 |
print(input_img)
|
@@ -237,17 +237,17 @@ input_img = input_img
|
|
237 |
output_img = st.empty()
|
238 |
|
239 |
# Buttons
|
240 |
-
restore = st.button('
|
241 |
-
reset = st.button('
|
242 |
|
243 |
# Restore clicked
|
244 |
if restore:
|
245 |
if input_img is not None:
|
246 |
output = realesrgan(input_img, model_name, denoise_strength,
|
247 |
face_enhance, outscale)
|
248 |
-
output_img.image(output, '
|
249 |
else:
|
250 |
-
st.warning('
|
251 |
|
252 |
# Reset clicked
|
253 |
if reset:
|
|
|
196 |
|
197 |
#------------
|
198 |
|
199 |
+
st.title("图像放大")
|
200 |
# Saving uploaded image in input folder for processing
|
201 |
|
202 |
#with st.expander("Options/Parameters"):
|
203 |
|
204 |
input_img = st.file_uploader(
|
205 |
+
"上传图片", type=['png', 'jpeg', 'jpg', 'webp'])
|
206 |
#save_image(input_img)
|
207 |
|
208 |
model_name = st.selectbox(
|
209 |
+
"要使用的 Real-ESRGAN 推理模型",
|
210 |
["RealESRGAN_x4plus", "RealESRNet_x4plus", "RealESRGAN_x4plus_anime_6B", "RealESRGAN_x2plus", "realesr-general-x4v3"],
|
211 |
index=4
|
212 |
)
|
|
|
214 |
#denoise_strength = st.slider("Denoise Strength (Used only with the realesr-general-x4v3 model)", 0.0, 1.0, 0.5)
|
215 |
denoise_strength = 0.5
|
216 |
|
217 |
+
outscale = st.slider("图像放大系数", 1, 10, 2)
|
218 |
|
219 |
+
face_enhance = st.checkbox("使用 GFPGAN 进行面部增强(不适用于动漫图像)")
|
220 |
|
221 |
if input_img:
|
222 |
print(input_img)
|
|
|
237 |
output_img = st.empty()
|
238 |
|
239 |
# Buttons
|
240 |
+
restore = st.button('开始')
|
241 |
+
reset = st.button('重置')
|
242 |
|
243 |
# Restore clicked
|
244 |
if restore:
|
245 |
if input_img is not None:
|
246 |
output = realesrgan(input_img, model_name, denoise_strength,
|
247 |
face_enhance, outscale)
|
248 |
+
output_img.image(output, '恢复图像')
|
249 |
else:
|
250 |
+
st.warning('请上传文件', icon="⚠️")
|
251 |
|
252 |
# Reset clicked
|
253 |
if reset:
|