Rename predictor postprocess `orig_img` to `orig_imgs` (#2877)

Signed-off-by: Afif Al Mamun <afifanik@gmail.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/2880/head
Afif Al Mamun 2 years ago committed by GitHub
parent dfe7f627d8
commit 75012e575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ultralytics/yolo/engine/predictor.py
  2. 4
      ultralytics/yolo/v8/pose/predict.py

@ -171,7 +171,7 @@ class BasePredictor:
return log_string
def postprocess(self, preds, img, orig_img):
def postprocess(self, preds, img, orig_imgs):
"""Post-processes predictions for an image and returns them."""
return preds

@ -11,7 +11,7 @@ class PosePredictor(DetectionPredictor):
super().__init__(cfg, overrides, _callbacks)
self.args.task = 'pose'
def postprocess(self, preds, img, orig_img):
def postprocess(self, preds, img, orig_imgs):
"""Return detection results for a given input image or list of images."""
preds = ops.non_max_suppression(preds,
self.args.conf,
@ -23,7 +23,7 @@ class PosePredictor(DetectionPredictor):
results = []
for i, pred in enumerate(preds):
orig_img = orig_img[i] if isinstance(orig_img, list) else orig_img
orig_img = orig_imgs[i] if isinstance(orig_imgs, list) else orig_imgs
shape = orig_img.shape
pred[:, :4] = ops.scale_boxes(img.shape[2:], pred[:, :4], shape).round()
pred_kpts = pred[:, 6:].view(len(pred), *self.model.kpt_shape) if len(pred) else pred[:, 6:]

Loading…
Cancel
Save