Spaces:
Runtime error
Runtime error
debug
Browse files
examples/blobctrl/blobctrl_app.py
CHANGED
@@ -73,6 +73,14 @@ if not os.path.exists(SAM_path):
|
|
73 |
)
|
74 |
print(f"SAM checkpoints downloaded to {SAM_path}")
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
## load models and pipeline
|
78 |
blobnet_path = "./examples/blobctrl/models/blobnet"
|
@@ -1504,17 +1512,8 @@ with block as demo:
|
|
1504 |
gr.Markdown("## **Step 1: Upload an image and click to segment the object**", show_label=False)
|
1505 |
|
1506 |
with gr.Row():
|
1507 |
-
|
1508 |
-
|
1509 |
-
label="Input Image",
|
1510 |
-
type="numpy",
|
1511 |
-
brush=gr.Brush(colors=["#FFFFFF"], default_size = 30, color_mode="fixed"),
|
1512 |
-
layers = False,
|
1513 |
-
interactive=True,
|
1514 |
-
height=576,
|
1515 |
-
sources=["upload"],
|
1516 |
-
placeholder="Please click here to upload the image.",
|
1517 |
-
)
|
1518 |
|
1519 |
with gr.Row(elem_id="Seg"):
|
1520 |
undo_seg_button = gr.Button('🔙 Undo Seg', elem_id="undo_btnSEG", scale=1)
|
|
|
73 |
)
|
74 |
print(f"SAM checkpoints downloaded to {SAM_path}")
|
75 |
|
76 |
+
# Check if SAM model file exists
|
77 |
+
sam_model_file = os.path.join(SAM_path, "sam_vt_h.pth")
|
78 |
+
if os.path.exists(sam_model_file):
|
79 |
+
print(f"SAM model file found at {sam_model_file}")
|
80 |
+
else:
|
81 |
+
print(f"SAM model file not found at {sam_model_file}")
|
82 |
+
|
83 |
+
|
84 |
|
85 |
## load models and pipeline
|
86 |
blobnet_path = "./examples/blobctrl/models/blobnet"
|
|
|
1512 |
gr.Markdown("## **Step 1: Upload an image and click to segment the object**", show_label=False)
|
1513 |
|
1514 |
with gr.Row():
|
1515 |
+
input_image = gr.Image(type="numpy", label="input", scale=2, height=576, interactive=True)
|
1516 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1517 |
|
1518 |
with gr.Row(elem_id="Seg"):
|
1519 |
undo_seg_button = gr.Button('🔙 Undo Seg', elem_id="undo_btnSEG", scale=1)
|