Daniel-F commited on
Commit
187d444
·
1 Parent(s): c8757ee
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -70,6 +70,11 @@ def segment_target(target_image, ref_image, ref_mask):
70
  out = sam_utils.propagate_masks(sam2_vid, state)[-1]['segmentation']
71
  return out # Just for placeholder demo
72
 
 
 
 
 
 
73
  def visualize_segmentation(image, masks, target_image, target_mask):
74
  # Visualize the segmentation result
75
  fig, ax = plt.subplots(1, 2, figsize=(12, 6))
 
70
  out = sam_utils.propagate_masks(sam2_vid, state)[-1]['segmentation']
71
  return out # Just for placeholder demo
72
 
73
+ def on_reference_upload(img):
74
+ global click_coords
75
+ click_coords = [] # clear the clicks
76
+ return "Click Info: Cleared (new image uploaded)"
77
+
78
  def visualize_segmentation(image, masks, target_image, target_mask):
79
  # Visualize the segmentation result
80
  fig, ax = plt.subplots(1, 2, figsize=(12, 6))