Replace enumerate + index with zip() (#14574)

This commit is contained in:
Kayzwer 2024-07-22 00:01:17 +08:00 committed by GitHub
parent 68f1f326f5
commit e59376b55f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 15 deletions

View file

@ -71,9 +71,7 @@ class FastSAMPredictor(DetectionPredictor):
results = []
proto = preds[1][-1] if len(preds[1]) == 3 else preds[1] # second output is len 3 if pt, but only 1 if exported
for i, pred in enumerate(p):
orig_img = orig_imgs[i]
img_path = self.batch[0][i]
for i, (pred, orig_img, img_path) in enumerate(zip(p, orig_imgs, self.batch[0])):
if not len(pred): # save empty boxes
masks = None
elif self.args.retina_masks: