Fix `_predict_augment` and add warning (#16056)

Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
pull/16071/head
Laughing 2 months ago committed by GitHub
parent d0dd2b9313
commit b00f4afefa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      ultralytics/nn/tasks.py

@ -341,11 +341,8 @@ class DetectionModel(BaseModel):
def _predict_augment(self, x):
"""Perform augmentations on input image x and return augmented inference and train outputs."""
if getattr(self, "end2end", False):
LOGGER.warning(
"WARNING ⚠ End2End model does not support 'augment=True' prediction. "
"Reverting to single-scale prediction."
)
if getattr(self, "end2end", False) or self.__class__.__name__ != "DetectionModel":
LOGGER.warning("WARNING ⚠ Model does not support 'augment=True', reverting to single-scale prediction.")
return self._predict_once(x)
img_size = x.shape[-2:] # height, width
s = [1, 0.83, 0.67] # scales

Loading…
Cancel
Save