ultralytics 8.0.122 Fix torch.Tensor inference (#3363)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: krzysztof.gonia <4281421+kgonia@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-06-25 01:36:07 +02:00 committed by GitHub
parent 51d8cfa9c3
commit 682c9ef70f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 471 additions and 154 deletions

View file

@ -198,6 +198,10 @@ class Results(SimpleClass):
Returns:
(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
# Deprecation warn TODO: remove in 8.2
if 'show_conf' in kwargs:
deprecation_warn('show_conf', 'conf')
@ -305,7 +309,7 @@ class Results(SimpleClass):
file_name (str | pathlib.Path): File name.
"""
if self.probs is not None:
LOGGER.warning('Warning: Classify task do not support `save_crop`.')
LOGGER.warning('WARNING ⚠️ Classify task do not support `save_crop`.')
return
if isinstance(save_dir, str):
save_dir = Path(save_dir)