Replace enumerate with zip in models/yolo (#14599)

This commit is contained in:
Kayzwer 2024-07-23 01:52:43 +08:00 committed by GitHub
parent 22a44d82c5
commit db82d1c6ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 12 deletions

View file

@ -42,9 +42,7 @@ class SegmentationPredictor(DetectionPredictor):
results = []
proto = preds[1][-1] if isinstance(preds[1], tuple) else preds[1] # tuple if PyTorch model or array 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: