Add warning for inference end2end models with augment arg (#13958)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
b10e0f3fa8
commit
be1722b4b8
2 changed files with 9 additions and 2 deletions
|
|
@ -151,8 +151,8 @@ class BaseModel(nn.Module):
|
|||
def _predict_augment(self, x):
|
||||
"""Perform augmentations on input image x and return augmented inference."""
|
||||
LOGGER.warning(
|
||||
f"WARNING ⚠️ {self.__class__.__name__} does not support augmented inference yet. "
|
||||
f"Reverting to single-scale inference instead."
|
||||
f"WARNING ⚠️ {self.__class__.__name__} does not support 'augment=True' prediction. "
|
||||
f"Reverting to single-scale prediction."
|
||||
)
|
||||
return self._predict_once(x)
|
||||
|
||||
|
|
@ -337,6 +337,12 @@ class DetectionModel(BaseModel):
|
|||
|
||||
def _predict_augment(self, x):
|
||||
"""Perform augmentations on input image x and return augmented inference and train outputs."""
|
||||
if self.end2end:
|
||||
LOGGER.warning(
|
||||
"WARNING ⚠️ End2End model does not support 'augment=True' prediction. "
|
||||
"Reverting to single-scale prediction."
|
||||
)
|
||||
return self._predict_once(x)
|
||||
img_size = x.shape[-2:] # height, width
|
||||
s = [1, 0.83, 0.67] # scales
|
||||
f = [None, 3, None] # flips (2-ud, 3-lr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue