Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -195,8 +195,10 @@ def app():
|
|
195 |
if len(points) == 0:
|
196 |
gr.Warning("No boxes are provided. No image output.", visible=True)
|
197 |
return gr.update(value=None)
|
|
|
198 |
prompts = {
|
199 |
-
"bboxes":
|
|
|
200 |
}
|
201 |
elif visual_prompt_type == "masks":
|
202 |
image, masks = mask_image["background"], mask_image["layers"][0]
|
@@ -208,7 +210,8 @@ def app():
|
|
208 |
gr.Warning("No masks are provided. No image output.", visible=True)
|
209 |
return gr.update(value=None)
|
210 |
prompts = {
|
211 |
-
"masks": masks[None]
|
|
|
212 |
}
|
213 |
return yoloe_inference(image, prompts, target_image, model_id, image_size, conf_thresh, iou_thresh, prompt_type)
|
214 |
|
|
|
195 |
if len(points) == 0:
|
196 |
gr.Warning("No boxes are provided. No image output.", visible=True)
|
197 |
return gr.update(value=None)
|
198 |
+
bboxes = np.array([p[[0, 1, 3, 4]] for p in points if p[2] == 2])
|
199 |
prompts = {
|
200 |
+
"bboxes": bboxes,
|
201 |
+
"cls": np.array([0] * len(bboxes))
|
202 |
}
|
203 |
elif visual_prompt_type == "masks":
|
204 |
image, masks = mask_image["background"], mask_image["layers"][0]
|
|
|
210 |
gr.Warning("No masks are provided. No image output.", visible=True)
|
211 |
return gr.update(value=None)
|
212 |
prompts = {
|
213 |
+
"masks": masks[None],
|
214 |
+
"cls": np.array([0])
|
215 |
}
|
216 |
return yoloe_inference(image, prompts, target_image, model_id, image_size, conf_thresh, iou_thresh, prompt_type)
|
217 |
|