From 4329269c4eee49a60e82dee8d94b1c61c4462293 Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Tue, 25 Jul 2023 21:56:15 +0800 Subject: [PATCH] Update augment in validator (#3943) Co-authored-by: Glenn Jocher --- ultralytics/engine/validator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ultralytics/engine/validator.py b/ultralytics/engine/validator.py index 4d0f9f5..e1382cd 100644 --- a/ultralytics/engine/validator.py +++ b/ultralytics/engine/validator.py @@ -95,6 +95,7 @@ class BaseValidator: if trainer is passed (trainer gets priority). """ self.training = trainer is not None + augment = self.args.augment and (not self.training) if self.training: self.device = trainer.device self.data = trainer.data @@ -159,7 +160,7 @@ class BaseValidator: # Inference with dt[1]: - preds = model(batch['img'], augment=self.args.augment) + preds = model(batch['img'], augment=augment) # Loss with dt[2]: