Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -160,15 +160,14 @@ with gr.Blocks() as demo:
|
|
160 |
gr.Markdown("# SAM2 Image Predictor")
|
161 |
with gr.Row():
|
162 |
with gr.Column():
|
163 |
-
input_image = gr.Image(label="input image", interactive=
|
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=
|
171 |
-
height=400
|
172 |
)
|
173 |
submit_btn = gr.Button("Submit")
|
174 |
with gr.Column():
|
@@ -182,10 +181,10 @@ with gr.Blocks() as demo:
|
|
182 |
queue=False
|
183 |
)
|
184 |
|
185 |
-
|
186 |
preprocess_image,
|
187 |
-
|
188 |
-
[first_frame_path, tracking_points, trackings_input_label,
|
189 |
queue=False
|
190 |
)
|
191 |
|
|
|
160 |
gr.Markdown("# SAM2 Image Predictor")
|
161 |
with gr.Row():
|
162 |
with gr.Column():
|
163 |
+
input_image = gr.Image(label="input image", interactive=False, type="filepath", visible=False)
|
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=True
|
|
|
171 |
)
|
172 |
submit_btn = gr.Button("Submit")
|
173 |
with gr.Column():
|
|
|
181 |
queue=False
|
182 |
)
|
183 |
|
184 |
+
points_map.upload(
|
185 |
preprocess_image,
|
186 |
+
points_map,
|
187 |
+
[first_frame_path, tracking_points, trackings_input_label, input_image],
|
188 |
queue=False
|
189 |
)
|
190 |
|