Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
95eb778
1
Parent(s):
de13e02
Input selection (shared component attempt)
Browse files
app.py
CHANGED
|
@@ -41,7 +41,9 @@ with block:
|
|
| 41 |
)
|
| 42 |
with gr.Row():
|
| 43 |
with gr.Column():
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
with gr.Row():
|
| 46 |
sam_encode_btn = gr.Button('Encode', variant='primary')
|
| 47 |
sam_sgmt_everything_btn = gr.Button('Segment Everything!', variant = 'primary')
|
|
@@ -60,7 +62,7 @@ with block:
|
|
| 60 |
pcl_figure = gr.Model3D(label="3-D Reconstruction", clear_color=[1.0, 1.0, 1.0, 1.0])
|
| 61 |
with gr.Row():
|
| 62 |
n_samples = gr.Slider(minimum=1e3, maximum=1e6, step=1e3, default=1e3, label='Number of Samples')
|
| 63 |
-
cube_size = gr.Slider(minimum=0.
|
| 64 |
depth_reconstruction_btn = gr.Button('Depth Reconstruction', variant = 'primary')
|
| 65 |
|
| 66 |
|
|
@@ -72,6 +74,11 @@ with block:
|
|
| 72 |
point_label_radio, text, reset_btn, sam_sgmt_everything_btn,
|
| 73 |
sam_decode_btn, depth_reconstruction_btn, prompt_image, lbl_image, n_samples, cube_size, selected_masks_image}
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
# event - init coords
|
| 76 |
def on_reset_btn_click(input_image):
|
| 77 |
return input_image, point_coords_empty(), point_labels_empty(), None, []
|
|
|
|
| 41 |
)
|
| 42 |
with gr.Row():
|
| 43 |
with gr.Column():
|
| 44 |
+
with gr.Tab():
|
| 45 |
+
input_image = gr.Image(label='Input', type='pil', tool=None) # mirror_webcam = False
|
| 46 |
+
input_image = gr.Image(label='Input', type='pil', tool=None, source="webcam") # mirror_webcam = False
|
| 47 |
with gr.Row():
|
| 48 |
sam_encode_btn = gr.Button('Encode', variant='primary')
|
| 49 |
sam_sgmt_everything_btn = gr.Button('Segment Everything!', variant = 'primary')
|
|
|
|
| 62 |
pcl_figure = gr.Model3D(label="3-D Reconstruction", clear_color=[1.0, 1.0, 1.0, 1.0])
|
| 63 |
with gr.Row():
|
| 64 |
n_samples = gr.Slider(minimum=1e3, maximum=1e6, step=1e3, default=1e3, label='Number of Samples')
|
| 65 |
+
cube_size = gr.Slider(minimum=0.00001, maximum=0.001, step=0.000001, default=0.00001, label='Cube size')
|
| 66 |
depth_reconstruction_btn = gr.Button('Depth Reconstruction', variant = 'primary')
|
| 67 |
|
| 68 |
|
|
|
|
| 74 |
point_label_radio, text, reset_btn, sam_sgmt_everything_btn,
|
| 75 |
sam_decode_btn, depth_reconstruction_btn, prompt_image, lbl_image, n_samples, cube_size, selected_masks_image}
|
| 76 |
|
| 77 |
+
#def on_upload_image(input_image, upload_image):
|
| 78 |
+
# return [upload_image, upload_image]
|
| 79 |
+
#upload_image.upload(on_upload_image, [input_image, upload_image], [input_image, upload_image])
|
| 80 |
+
|
| 81 |
+
|
| 82 |
# event - init coords
|
| 83 |
def on_reset_btn_click(input_image):
|
| 84 |
return input_image, point_coords_empty(), point_labels_empty(), None, []
|