hengli commited on
Commit
08a108c
·
1 Parent(s): 6b03b8b

adding samples

Browse files
Files changed (2) hide show
  1. .gitattributes +3 -0
  2. app.py +58 -103
.gitattributes CHANGED
@@ -34,3 +34,6 @@ saved_model/**/* 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
  docs/traj_ply.png 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
  docs/traj_ply.png filter=lfs diff=lfs merge=lfs -text
37
+ samples/barn_images.mp4 filter=lfs diff=lfs merge=lfs -text
38
+ samples/room.mp4 filter=lfs diff=lfs merge=lfs -text
39
+ samples/rgbd_dataset_freiburg1_360.mp4 filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -578,14 +578,14 @@ with gr.Blocks(
578
  conf_thres = gr.Slider(
579
  minimum=0,
580
  maximum=100,
581
- value=50,
582
  step=0.1,
583
  label="Confidence Threshold (%)",
584
  )
585
  downsample_ratio = gr.Slider(
586
  minimum=1.0,
587
  maximum=100,
588
- value=100,
589
  step=0.1,
590
  label="Downsample Ratio(%)",
591
  )
@@ -605,103 +605,58 @@ with gr.Blocks(
605
  # ---------------------- Examples section ----------------------
606
  examples = [
607
  [
608
- colosseum_video,
609
- "22",
610
- None,
611
- 20.0,
612
- False,
613
- False,
614
- True,
615
- False,
616
- "Depthmap and Camera Branch",
617
- "True",
618
- ],
619
- [
620
- pyramid_video,
621
- "30",
622
- None,
623
- 35.0,
624
- False,
625
- False,
626
- True,
627
- False,
628
- "Depthmap and Camera Branch",
629
- "True",
630
- ],
631
- [
632
- single_cartoon_video,
633
- "1",
634
  None,
635
- 15.0,
636
  False,
637
  False,
638
  True,
639
  False,
 
640
  "Depthmap and Camera Branch",
641
  "True",
642
  ],
643
- [
644
- single_oil_painting_video,
645
- "1",
646
- None,
647
- 20.0,
648
- False,
649
- False,
650
- True,
651
- True,
652
- "Depthmap and Camera Branch",
653
- "True",
654
- ],
655
- [
656
- room_video,
657
- "8",
658
  None,
659
- 5.0,
660
  False,
661
  False,
662
  True,
663
  False,
664
- "Depthmap and Camera Branch",
665
- "True",
666
- ],
667
- [
668
- kitchen_video,
669
- "25",
670
- None,
671
  50.0,
672
- False,
673
- False,
674
- True,
675
- False,
676
  "Depthmap and Camera Branch",
677
  "True",
678
  ],
679
- [
680
- fern_video,
681
- "20",
682
  None,
683
- 45.0,
684
  False,
685
  False,
686
  True,
687
  False,
 
688
  "Depthmap and Camera Branch",
689
  "True",
690
  ],
691
  ]
692
 
693
  def example_pipeline(
694
- input_video,
695
- num_images_str,
696
- input_images,
697
- conf_thres,
698
- mask_black_bg,
699
- mask_white_bg,
700
- show_cam,
701
- mask_sky,
702
- downsample_ratio,
703
- prediction_mode,
704
- is_example_str,
705
  ):
706
  """
707
  1) Copy example images to new target_dir
@@ -712,41 +667,41 @@ with gr.Blocks(
712
  target_dir, image_paths = handle_uploads(input_video, input_images)
713
  # Always use "All" for frame_filter in examples
714
  frame_filter = "All"
715
- glbfile, log_msg, dropdown = gradio_demo(
716
- target_dir,
717
- conf_thres,
718
- frame_filter,
719
- mask_black_bg,
720
- mask_white_bg,
721
- show_cam,
722
- mask_sky,
723
- downsample_ratio,
724
- prediction_mode,
725
- )
726
- return glbfile, log_msg, target_dir, dropdown, image_paths
727
 
728
  gr.Markdown("Click any row to load an example.", elem_classes=["example-log"])
729
 
730
- # gr.Examples(
731
- # examples=examples,
732
- # inputs=[
733
- # input_video,
734
- # num_images,
735
- # input_images,
736
- # conf_thres,
737
- # mask_black_bg,
738
- # mask_white_bg,
739
- # show_cam,
740
- # mask_sky,
741
- # downsample_ratio,
742
- # prediction_mode,
743
- # is_example,
744
- # ],
745
- # outputs=[reconstruction_output, log_output, target_dir_output, frame_filter, image_gallery],
746
- # fn=example_pipeline,
747
- # cache_examples=False,
748
- # examples_per_page=50,
749
- # )
750
 
751
  # -------------------------------------------------------------------------
752
  # "Reconstruct" button logic:
 
578
  conf_thres = gr.Slider(
579
  minimum=0,
580
  maximum=100,
581
+ value=70,
582
  step=0.1,
583
  label="Confidence Threshold (%)",
584
  )
585
  downsample_ratio = gr.Slider(
586
  minimum=1.0,
587
  maximum=100,
588
+ value=20,
589
  step=0.1,
590
  label="Downsample Ratio(%)",
591
  )
 
605
  # ---------------------- Examples section ----------------------
606
  examples = [
607
  [
608
+ "samples/kitchen.mp4",
609
+ "25",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
610
  None,
611
+ "5.0",
612
  False,
613
  False,
614
  True,
615
  False,
616
+ 50.0,
617
  "Depthmap and Camera Branch",
618
  "True",
619
  ],
620
+ [
621
+ "samples/barn_images.mp4",
622
+ "410",
 
 
 
 
 
 
 
 
 
 
 
 
623
  None,
624
+ "5.0",
625
  False,
626
  False,
627
  True,
628
  False,
 
 
 
 
 
 
 
629
  50.0,
 
 
 
 
630
  "Depthmap and Camera Branch",
631
  "True",
632
  ],
633
+ [
634
+ "samples/rgbd_dataset_freiburg1_360.mp4",
635
+ "410",
636
  None,
637
+ "5.0",
638
  False,
639
  False,
640
  True,
641
  False,
642
+ 50.0,
643
  "Depthmap and Camera Branch",
644
  "True",
645
  ],
646
  ]
647
 
648
  def example_pipeline(
649
+ input_video: str,
650
+ num_images_str: str|None,
651
+ input_images: str|None,
652
+ conf_thres: str,
653
+ mask_black_bg: bool,
654
+ mask_white_bg: bool,
655
+ show_cam: bool,
656
+ mask_sky: bool,
657
+ downsample_ratio: float,
658
+ prediction_mode: str,
659
+ is_example_str: str,
660
  ):
661
  """
662
  1) Copy example images to new target_dir
 
667
  target_dir, image_paths = handle_uploads(input_video, input_images)
668
  # Always use "All" for frame_filter in examples
669
  frame_filter = "All"
670
+ # glbfile, log_msg, dropdown = gradio_demo(
671
+ # target_dir,
672
+ # conf_thres,
673
+ # frame_filter,
674
+ # mask_black_bg,
675
+ # mask_white_bg,
676
+ # show_cam,
677
+ # mask_sky,
678
+ # downsample_ratio,
679
+ # prediction_mode,
680
+ # )
681
+ # return glbfile, log_msg, target_dir, dropdown, image_paths
682
 
683
  gr.Markdown("Click any row to load an example.", elem_classes=["example-log"])
684
 
685
+ gr.Examples(
686
+ examples=examples,
687
+ inputs=[
688
+ input_video,
689
+ num_images,
690
+ input_images,
691
+ # conf_thres,
692
+ # # mask_black_bg,
693
+ # # mask_white_bg,
694
+ # # show_cam,
695
+ # # mask_sky,
696
+ # # downsample_ratio,
697
+ # # prediction_mode,
698
+ # # is_example,
699
+ ],
700
+ outputs=[reconstruction_output, log_output, target_dir_output, frame_filter, image_gallery],
701
+ fn=example_pipeline,
702
+ cache_examples=False,
703
+ examples_per_page=50,
704
+ )
705
 
706
  # -------------------------------------------------------------------------
707
  # "Reconstruct" button logic: