Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
a5559ee
1
Parent(s):
2267dd9
QQQ
Browse files
app.py
CHANGED
|
@@ -40,14 +40,6 @@ from huggingface_hub import hf_hub_download
|
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
-
# EXAMPLES = [
|
| 44 |
-
# ["https://huggingface.co/hanquansanren/DvD/resolve/main/examples/25_1.png"],
|
| 45 |
-
# ["https://huggingface.co/hanquansanren/DvD/resolve/main/examples/3_2.png"],
|
| 46 |
-
# ]
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
|
| 52 |
|
| 53 |
reg_model_bilin = register_model2((512,512), 'bilinear')
|
|
@@ -399,27 +391,20 @@ if __name__ == '__main__':
|
|
| 399 |
# example_img_list.append(local_path)
|
| 400 |
|
| 401 |
print(example_img_list)
|
| 402 |
-
EXAMPLES = [
|
| 403 |
-
["examples/3_2 copy.png"],
|
| 404 |
-
["examples/25_1 copy.png"]
|
| 405 |
-
]
|
| 406 |
|
| 407 |
|
| 408 |
with gr.Blocks() as demo:
|
| 409 |
-
gr.Markdown("
|
|
|
|
| 410 |
|
| 411 |
with gr.Row():
|
| 412 |
input_image = gr.Image(type="pil", label="Input Image")
|
| 413 |
output_image = gr.Image(type="numpy", label="Output Image")
|
| 414 |
-
|
| 415 |
-
# 加载 Examples 到输入框
|
| 416 |
gr.Examples(
|
| 417 |
examples=example_img_list,
|
| 418 |
inputs=[input_image],
|
| 419 |
label="Click an example to load into Input Image"
|
| 420 |
)
|
| 421 |
-
|
| 422 |
-
# 按钮运行函数
|
| 423 |
run_btn = gr.Button("Run")
|
| 424 |
run_btn.click(fn=run_single_docunet, inputs=[input_image], outputs=[output_image])
|
| 425 |
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
reg_model_bilin = register_model2((512,512), 'bilinear')
|
|
|
|
| 391 |
# example_img_list.append(local_path)
|
| 392 |
|
| 393 |
print(example_img_list)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
|
| 395 |
|
| 396 |
with gr.Blocks() as demo:
|
| 397 |
+
gr.Markdown("<h2 style='text-align: center;'>Document Image Dewarping Demo</h2>")
|
| 398 |
+
gr.Markdown("This is a demo for SIGGRAPH Asia 2025 paper 'DvD: Unleashing a Generative Paradigm for Document Dewarping via Coordinates-based Diffusion Model' ")
|
| 399 |
|
| 400 |
with gr.Row():
|
| 401 |
input_image = gr.Image(type="pil", label="Input Image")
|
| 402 |
output_image = gr.Image(type="numpy", label="Output Image")
|
|
|
|
|
|
|
| 403 |
gr.Examples(
|
| 404 |
examples=example_img_list,
|
| 405 |
inputs=[input_image],
|
| 406 |
label="Click an example to load into Input Image"
|
| 407 |
)
|
|
|
|
|
|
|
| 408 |
run_btn = gr.Button("Run")
|
| 409 |
run_btn.click(fn=run_single_docunet, inputs=[input_image], outputs=[output_image])
|
| 410 |
|