jens commited on
Commit
d7bd88e
·
1 Parent(s): fe0db59

segment everything!

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -39,9 +39,7 @@ with block:
39
  with gr.Row():
40
  prompt_image = gr.Image(label='Segments')
41
  prompt_lbl_image = gr.AnnotatedImage(label='Segment Labels')
42
-
43
- with gr.Tab("Select from segmented map"):
44
- everything_image = gr.AnnotatedImage(label='Everything')
45
 
46
  with gr.Row():
47
  with gr.Column():
@@ -122,6 +120,13 @@ with block:
122
  return {pcl_figure: path}
123
  depth_reconstruction_btn.click(on_depth_reconstruction_btn_click, components, [pcl_figure], queue=False)
124
 
 
 
 
 
 
 
 
125
 
126
  if __name__ == '__main__':
127
  block.queue()
 
39
  with gr.Row():
40
  prompt_image = gr.Image(label='Segments')
41
  prompt_lbl_image = gr.AnnotatedImage(label='Segment Labels')
42
+ everything_image = gr.AnnotatedImage(label='Everything')
 
 
43
 
44
  with gr.Row():
45
  with gr.Column():
 
120
  return {pcl_figure: path}
121
  depth_reconstruction_btn.click(on_depth_reconstruction_btn_click, components, [pcl_figure], queue=False)
122
 
123
+ def on_sam_sgmt_everything_btn_click(inputs):
124
+ print("segmenting everything")
125
+ image = inputs[input_image]
126
+ annotated_image = sam.segment_everything(image)
127
+ return [annotated_image]
128
+ sam_sgmt_everything_btn.click(on_sam_sgmt_everything_btn_click, components, [everything_image], queue=False)
129
+
130
 
131
  if __name__ == '__main__':
132
  block.queue()