pablovela5620 commited on
Commit
89d8b05
1 Parent(s): 1bc0980

track with git lfs and add examples

Browse files
.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: str) -> 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,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
- singe_image = gr.Image(type="filepath")
93
  run_btn_single = gr.Button("Run")
94
  rerun_viewer_single = Rerun(height=900)
95
  run_btn_single.click(
96
- fn=predict, inputs=[singe_image], outputs=[rerun_viewer_single]
 
 
 
 
 
 
 
 
 
 
 
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

  • SHA256: 8c0faac2d617c958efeb21a21acba6746e245d187f2d27ed7b66969302201086
  • Pointer size: 132 Bytes
  • Size of remote file: 4.62 MB
examples/single_image/example2.png ADDED

Git LFS Details

  • SHA256: 83f65587f843355759a216577776a2a8f3540bfda7f5c73753e57e9c7ccd59a6
  • Pointer size: 132 Bytes
  • Size of remote file: 2.82 MB
examples/single_image/example3.png ADDED

Git LFS Details

  • SHA256: 2eb4ea2cce9ba6e9326c029809067bb77d3c9e5527fcd8a3fe8b11bb3c252146
  • Pointer size: 131 Bytes
  • Size of remote file: 488 kB
examples/single_image/example4.png ADDED

Git LFS Details

  • SHA256: a23dec9695cff9b57e4f4d5c119fad8887a6e7caad99de207d823e5278498fcd
  • Pointer size: 132 Bytes
  • Size of remote file: 3.94 MB