Add torch.Tensor results image saving (#3475)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
cd0bf05aa4
commit
586c95b8a9
2 changed files with 1 additions and 6 deletions
|
|
@ -199,8 +199,7 @@ class Results(SimpleClass):
|
|||
(numpy.ndarray): A numpy array of the annotated image.
|
||||
"""
|
||||
if img is None and isinstance(self.orig_img, torch.Tensor):
|
||||
LOGGER.warning('WARNING ⚠️ Results plotting is not supported for torch.Tensor image types.')
|
||||
return
|
||||
img = np.ascontiguousarray(self.orig_img[0].permute(1, 2, 0).cpu().detach().numpy()) * 255
|
||||
|
||||
# Deprecation warn TODO: remove in 8.2
|
||||
if 'show_conf' in kwargs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue