fffiloni commited on
Commit
2db5059
·
verified ·
1 Parent(s): e6603c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
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=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():
@@ -182,10 +181,10 @@ with gr.Blocks() as demo:
182
  queue=False
183
  )
184
 
185
- input_image.upload(
186
  preprocess_image,
187
- input_image,
188
- [first_frame_path, tracking_points, trackings_input_label, points_map],
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