Skip to content

Commit

Permalink
Segment TensorRT batch=3 fix (#7952)
Browse files Browse the repository at this point in the history
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
3 people committed Feb 1, 2024
1 parent 68de79d commit 66b32bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ultralytics/models/yolo/segment/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def postprocess(self, preds, img, orig_imgs):
orig_imgs = ops.convert_torch2numpy_batch(orig_imgs)

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
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]
Expand Down

0 comments on commit 66b32bb

Please sign in to comment.