bug fix
Browse files
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))
|