Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -258,8 +258,9 @@ def start_process(input1, input2, shape0_str, shape1_str, input_suffix=".pth"):
|
|
258 |
# 压缩包内文件夹名称
|
259 |
zip_folder_name = f"models-{input2}"
|
260 |
# 重命名后的文件名
|
261 |
-
|
262 |
-
|
|
|
263 |
# 创建压缩包
|
264 |
with zipfile.ZipFile(zip_file_name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
265 |
# 写入重命名后的.bin文件
|
@@ -273,7 +274,7 @@ def start_process(input1, input2, shape0_str, shape1_str, input_suffix=".pth"):
|
|
273 |
log += f"未找到 ncnn 文件\n"
|
274 |
print_log(task_id, input2, "查找 ncnn 文件", "失败")
|
275 |
yield [], log
|
276 |
-
|
277 |
output_files = [os.path.join(output_folder, f) for f in os.listdir(output_folder) if os.path.isfile(os.path.join(output_folder, f))]
|
278 |
log += f"任务完成\n"
|
279 |
print_log(task_id, input2, "执行命令", "完成")
|
@@ -326,7 +327,8 @@ with gr.Blocks() as demo:
|
|
326 |
examples = [
|
327 |
["https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth", "", "1,3,128,128", "0,0,0,0"],
|
328 |
["https://github.com/Phhofm/models/releases/download/4xNomos8kSC/4xNomos8kSC.pth", "", "1,3,128,128", "0,0,0,0"],
|
329 |
-
["https://github.com/Phhofm/models/releases/download/1xDeJPG/1xDeJPG_SRFormer_light.pth", "", "1,3,128,128", "0,0,0,0"]
|
|
|
330 |
]
|
331 |
gr.Examples(
|
332 |
examples=examples,
|
|
|
258 |
# 压缩包内文件夹名称
|
259 |
zip_folder_name = f"models-{input2}"
|
260 |
# 重命名后的文件名
|
261 |
+
scale = int(width_ratio)
|
262 |
+
new_bin_name = f"x{scale}.bin"
|
263 |
+
new_param_name = f"x{scale}.param"
|
264 |
# 创建压缩包
|
265 |
with zipfile.ZipFile(zip_file_name, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
266 |
# 写入重命名后的.bin文件
|
|
|
274 |
log += f"未找到 ncnn 文件\n"
|
275 |
print_log(task_id, input2, "查找 ncnn 文件", "失败")
|
276 |
yield [], log
|
277 |
+
|
278 |
output_files = [os.path.join(output_folder, f) for f in os.listdir(output_folder) if os.path.isfile(os.path.join(output_folder, f))]
|
279 |
log += f"任务完成\n"
|
280 |
print_log(task_id, input2, "执行命令", "完成")
|
|
|
327 |
examples = [
|
328 |
["https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth", "", "1,3,128,128", "0,0,0,0"],
|
329 |
["https://github.com/Phhofm/models/releases/download/4xNomos8kSC/4xNomos8kSC.pth", "", "1,3,128,128", "0,0,0,0"],
|
330 |
+
["https://github.com/Phhofm/models/releases/download/1xDeJPG/1xDeJPG_SRFormer_light.pth", "", "1,3,128,128", "0,0,0,0"],
|
331 |
+
["https://objectstorage.us-phoenix-1.oraclecloud.com/n/ax6ygfvpvzka/b/open-modeldb-files/o/4x-WTP-ColorDS.pth", "", "1,3,128,128", "0,0,0,0"],
|
332 |
]
|
333 |
gr.Examples(
|
334 |
examples=examples,
|