developer0hye commited on
Commit
1547c70
·
verified ·
1 Parent(s): d58546f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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)