Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,10 +118,15 @@ with gr.Blocks() as demo:
|
|
| 118 |
persp_input = gr.File(label="Upload Perspective Image", file_types=[".jpg",".png",".jpeg"])
|
| 119 |
json_input = gr.File(label="Upload mockup.json", file_types=[".json"])
|
| 120 |
with gr.Row():
|
| 121 |
-
gr.Image(type="filepath", label="Flat Image Preview"
|
| 122 |
-
gr.Image(type="filepath", label="Perspective Image Preview"
|
| 123 |
output_gallery = gr.Gallery(label="Perspective ROI Results", show_label=True, columns=2, height=600)
|
| 124 |
run_btn = gr.Button("Run Homography")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
run_btn.click(homography_demo, inputs=[flat_input, persp_input, json_input], outputs=output_gallery)
|
| 126 |
|
| 127 |
demo.launch()
|
|
|
|
| 118 |
persp_input = gr.File(label="Upload Perspective Image", file_types=[".jpg",".png",".jpeg"])
|
| 119 |
json_input = gr.File(label="Upload mockup.json", file_types=[".json"])
|
| 120 |
with gr.Row():
|
| 121 |
+
flat_preview = gr.Image(type="filepath", label="Flat Image Preview", height=200)
|
| 122 |
+
persp_preview = gr.Image(type="filepath", label="Perspective Image Preview", height=200)
|
| 123 |
output_gallery = gr.Gallery(label="Perspective ROI Results", show_label=True, columns=2, height=600)
|
| 124 |
run_btn = gr.Button("Run Homography")
|
| 125 |
+
|
| 126 |
+
# Link previews
|
| 127 |
+
flat_input.change(lambda f: f.name if f else None, inputs=flat_input, outputs=flat_preview)
|
| 128 |
+
persp_input.change(lambda f: f.name if f else None, inputs=persp_input, outputs=persp_preview)
|
| 129 |
+
|
| 130 |
run_btn.click(homography_demo, inputs=[flat_input, persp_input, json_input], outputs=output_gallery)
|
| 131 |
|
| 132 |
demo.launch()
|