Update app.py
Browse files
app.py
CHANGED
|
@@ -159,15 +159,21 @@ with gr.Blocks() as demo:
|
|
| 159 |
with gr.Column():
|
| 160 |
gr.Markdown("# SAM2 Image Predictor")
|
| 161 |
with gr.Row():
|
| 162 |
-
input_image = gr.Image(label="input image", interactive=True, type="filepath")
|
| 163 |
with gr.Column():
|
|
|
|
| 164 |
with gr.Row():
|
| 165 |
point_type = gr.Radio(label="point type", choices=["include", "exclude"], value="include")
|
| 166 |
clear_points_btn = gr.Button("Clear Points")
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
clear_points_btn.click(
|
| 173 |
fn = preprocess_image,
|
|
|
|
| 159 |
with gr.Column():
|
| 160 |
gr.Markdown("# SAM2 Image Predictor")
|
| 161 |
with gr.Row():
|
|
|
|
| 162 |
with gr.Column():
|
| 163 |
+
input_image = gr.Image(label="input image", interactive=True, type="filepath")
|
| 164 |
with gr.Row():
|
| 165 |
point_type = gr.Radio(label="point type", choices=["include", "exclude"], value="include")
|
| 166 |
clear_points_btn = gr.Button("Clear Points")
|
| 167 |
+
with gr.Column():
|
| 168 |
+
points_map = gr.Image(
|
| 169 |
+
label="points map",
|
| 170 |
+
interactive=False,
|
| 171 |
+
height=400
|
| 172 |
+
)
|
| 173 |
+
submit_btn = gr.Button("Submit")
|
| 174 |
+
with gr.Column():
|
| 175 |
+
output_result = gr.Image()
|
| 176 |
+
output_result_mask = gr.Image()
|
| 177 |
|
| 178 |
clear_points_btn.click(
|
| 179 |
fn = preprocess_image,
|