Spaces:
Running on Zero
Running on Zero
Commit ·
89d8b05
1
Parent(s): 1bc0980
track with git lfs and add examples
Browse files- .gitattributes +1 -0
- app.py +20 -3
- examples/single_image/example1.png +3 -0
- examples/single_image/example2.png +3 -0
- examples/single_image/example3.png +3 -0
- examples/single_image/example4.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -17,7 +17,7 @@ model = AsymmetricCroCo3DStereo.from_pretrained(
|
|
| 17 |
).to(DEVICE)
|
| 18 |
|
| 19 |
|
| 20 |
-
def create_blueprint(image_name_list: list[str], log_path:
|
| 21 |
# dont show 2d views if there are more than 4 images as to not clutter the view
|
| 22 |
if len(image_name_list) > 4:
|
| 23 |
blueprint = rrb.Blueprint(
|
|
@@ -87,13 +87,30 @@ with gr.Blocks(
|
|
| 87 |
) as demo:
|
| 88 |
# scene state is save so that you can change conf_thr, cam_size... without rerunning the inference
|
| 89 |
gr.HTML('<h2 style="text-align: center;">Mini-DUSt3R Demo</h2>')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
with gr.Tab(label="Single Image"):
|
| 91 |
with gr.Column():
|
| 92 |
-
|
| 93 |
run_btn_single = gr.Button("Run")
|
| 94 |
rerun_viewer_single = Rerun(height=900)
|
| 95 |
run_btn_single.click(
|
| 96 |
-
fn=predict, inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
)
|
| 98 |
with gr.Tab(label="Multi Image"):
|
| 99 |
with gr.Column():
|
|
|
|
| 17 |
).to(DEVICE)
|
| 18 |
|
| 19 |
|
| 20 |
+
def create_blueprint(image_name_list: list[str], log_path: Path) -> rrb.Blueprint:
|
| 21 |
# dont show 2d views if there are more than 4 images as to not clutter the view
|
| 22 |
if len(image_name_list) > 4:
|
| 23 |
blueprint = rrb.Blueprint(
|
|
|
|
| 87 |
) as demo:
|
| 88 |
# scene state is save so that you can change conf_thr, cam_size... without rerunning the inference
|
| 89 |
gr.HTML('<h2 style="text-align: center;">Mini-DUSt3R Demo</h2>')
|
| 90 |
+
gr.HTML(
|
| 91 |
+
'<p style="text-align: center;">Unofficial DUSt3R demo using the mini-dust3r pip package</p>'
|
| 92 |
+
)
|
| 93 |
+
gr.HTML(
|
| 94 |
+
'<p style="text-align: center;">More info <a href="https://github.com/pablovela5620/mini-dust3r">here</a></p>'
|
| 95 |
+
)
|
| 96 |
with gr.Tab(label="Single Image"):
|
| 97 |
with gr.Column():
|
| 98 |
+
single_image = gr.Image(type="filepath", height=300)
|
| 99 |
run_btn_single = gr.Button("Run")
|
| 100 |
rerun_viewer_single = Rerun(height=900)
|
| 101 |
run_btn_single.click(
|
| 102 |
+
fn=predict, inputs=[single_image], outputs=[rerun_viewer_single]
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
example_single_dir = Path("examples/single_image")
|
| 106 |
+
example_single_files = sorted(example_single_dir.glob("*.png"))
|
| 107 |
+
|
| 108 |
+
examples_single = gr.Examples(
|
| 109 |
+
examples=example_single_files,
|
| 110 |
+
inputs=[single_image],
|
| 111 |
+
outputs=[rerun_viewer_single],
|
| 112 |
+
fn=predict,
|
| 113 |
+
cache_examples="lazy",
|
| 114 |
)
|
| 115 |
with gr.Tab(label="Multi Image"):
|
| 116 |
with gr.Column():
|
examples/single_image/example1.png
ADDED
|
Git LFS Details
|
examples/single_image/example2.png
ADDED
|
Git LFS Details
|
examples/single_image/example3.png
ADDED
|
Git LFS Details
|
examples/single_image/example4.png
ADDED
|
Git LFS Details
|