ultralytics 8.0.30
Docker, rect, data=*.zip updates (#832)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
@ -156,6 +156,7 @@ class YOLO:
|
||||
**kwargs : Any other args accepted by the validators. To see all args check 'configuration' section in docs
|
||||
"""
|
||||
overrides = self.overrides.copy()
|
||||
overrides["rect"] = True # rect batches as default
|
||||
overrides.update(kwargs)
|
||||
overrides["mode"] = "val"
|
||||
args = get_cfg(cfg=DEFAULT_CFG, overrides=overrides)
|
||||
|
@ -116,13 +116,16 @@ class BaseTrainer:
|
||||
|
||||
# Model and Dataloaders.
|
||||
self.model = self.args.model
|
||||
self.data = self.args.data
|
||||
if self.data.endswith(".yaml"):
|
||||
self.data = check_det_dataset(self.data)
|
||||
elif self.args.task == 'classify':
|
||||
self.data = check_cls_dataset(self.data)
|
||||
else:
|
||||
raise FileNotFoundError(emojis(f"Dataset '{self.args.data}' not found ❌"))
|
||||
try:
|
||||
if self.args.task == 'classify':
|
||||
self.data = check_cls_dataset(self.args.data)
|
||||
elif self.args.data.endswith(".yaml") or self.args.task in ('detect', 'segment'):
|
||||
self.data = check_det_dataset(self.args.data)
|
||||
if 'yaml_file' in self.data:
|
||||
self.args.data = self.data['yaml_file'] # for validating 'yolo train data=url.zip' usage
|
||||
except Exception as e:
|
||||
raise FileNotFoundError(emojis(f"Dataset '{self.args.data}' error ❌ {e}")) from e
|
||||
|
||||
self.trainset, self.testset = self.get_dataset(self.data)
|
||||
self.ema = None
|
||||
|
||||
|
@ -117,6 +117,8 @@ class BaseValidator:
|
||||
|
||||
if self.device.type == 'cpu':
|
||||
self.args.workers = 0 # faster CPU val as time dominated by inference, not dataloading
|
||||
if not pt:
|
||||
self.args.rect = False
|
||||
self.dataloader = self.dataloader or \
|
||||
self.get_dataloader(self.data.get("val") or self.data.set("test"), self.args.batch)
|
||||
|
||||
|
Reference in New Issue
Block a user