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>
single_channel
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

@ -171,7 +171,7 @@ class BasePredictor:
return log_string 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.""" """Post-processes predictions for an image and returns them."""
return preds return preds

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

Loading…
Cancel
Save