Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,6 +63,8 @@ def run_grounding(input_image, grounding_caption, box_threshold, text_threshold)
|
|
| 63 |
|
| 64 |
for i, (box, score, label) in enumerate(zip(result["boxes"], result["scores"], result["labels"])):
|
| 65 |
# box is xyxy format [xmin, ymin, xmax, ymax]
|
|
|
|
|
|
|
| 66 |
xyxy = box.tolist()
|
| 67 |
boxes.append(xyxy)
|
| 68 |
labels.append(label)
|
|
|
|
| 63 |
|
| 64 |
for i, (box, score, label) in enumerate(zip(result["boxes"], result["scores"], result["labels"])):
|
| 65 |
# box is xyxy format [xmin, ymin, xmax, ymax]
|
| 66 |
+
if label.strip() == "":
|
| 67 |
+
continue
|
| 68 |
xyxy = box.tolist()
|
| 69 |
boxes.append(xyxy)
|
| 70 |
labels.append(label)
|