jbilcke-hf HF Staff commited on
Commit
3dda9fb
·
1 Parent(s): 3e21e04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -550,8 +550,8 @@ def run_anything_task(input_image, text_prompt, box_threshold, text_threshold,
550
 
551
  results = []
552
 
553
- i = 0
554
- for mask in masks:
555
  color = np.concatenate([np.random.random(3), np.array([0.6])], axis=0)
556
  # color = np.array([30/255, 144/255, 255/255, 0.6])
557
  show_mask(mask.cpu().numpy(), plt.gca(), color)
@@ -561,7 +561,6 @@ def run_anything_task(input_image, text_prompt, box_threshold, text_threshold,
561
  "label": boxes_with_labels[i][1],
562
  "color": color
563
  }
564
- i++
565
  results.append(item)
566
  for box, label in boxes_with_labels:
567
  show_box(box.cpu().numpy(), plt.gca(), label)
 
550
 
551
  results = []
552
 
553
+
554
+ for i, mask in enumerate(masks):
555
  color = np.concatenate([np.random.random(3), np.array([0.6])], axis=0)
556
  # color = np.array([30/255, 144/255, 255/255, 0.6])
557
  show_mask(mask.cpu().numpy(), plt.gca(), color)
 
561
  "label": boxes_with_labels[i][1],
562
  "color": color
563
  }
 
564
  results.append(item)
565
  for box, label in boxes_with_labels:
566
  show_box(box.cpu().numpy(), plt.gca(), label)