ultralytics 8.0.209 fix P6 model validation (#6261)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Jie Li <32835610+jedi007@users.noreply.github.com> Co-authored-by: Haruto Watahiki <43723360+WATA-Haru@users.noreply.github.com>
This commit is contained in:
parent
87233ea17c
commit
9a5891444e
48 changed files with 95 additions and 92 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
__version__ = '8.0.208'
|
||||
__version__ = '8.0.209'
|
||||
|
||||
from ultralytics.models import RTDETR, SAM, YOLO
|
||||
from ultralytics.models.fastsam import FastSAM
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class BaseValidator:
|
|||
self.args = get_cfg(overrides=args)
|
||||
self.dataloader = dataloader
|
||||
self.pbar = pbar
|
||||
self.model = None
|
||||
self.stride = None
|
||||
self.data = None
|
||||
self.device = None
|
||||
self.batch_i = None
|
||||
|
|
@ -146,6 +146,7 @@ class BaseValidator:
|
|||
self.args.workers = 0 # faster CPU val as time dominated by inference, not dataloading
|
||||
if not pt:
|
||||
self.args.rect = False
|
||||
self.stride = model.stride # used in get_dataloader() for padding
|
||||
self.dataloader = self.dataloader or self.get_dataloader(self.data.get(self.args.split), self.args.batch)
|
||||
|
||||
model.eval()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ from ultralytics.utils import LOGGER, ops
|
|||
from ultralytics.utils.checks import check_requirements
|
||||
from ultralytics.utils.metrics import ConfusionMatrix, DetMetrics, box_iou
|
||||
from ultralytics.utils.plotting import output_to_target, plot_images
|
||||
from ultralytics.utils.torch_utils import de_parallel
|
||||
|
||||
|
||||
class DetectionValidator(BaseValidator):
|
||||
|
|
@ -191,8 +190,7 @@ class DetectionValidator(BaseValidator):
|
|||
mode (str): `train` mode or `val` mode, users are able to customize different augmentations for each mode.
|
||||
batch (int, optional): Size of batches, this is for `rect`. Defaults to None.
|
||||
"""
|
||||
gs = max(int(de_parallel(self.model).stride if self.model else 0), 32)
|
||||
return build_yolo_dataset(self.args, img_path, batch, self.data, mode=mode, stride=gs)
|
||||
return build_yolo_dataset(self.args, img_path, batch, self.data, mode=mode, stride=self.stride)
|
||||
|
||||
def get_dataloader(self, dataset_path, batch_size):
|
||||
"""Construct and return dataloader."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue