YOLOv5 updates (#90)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
ebd3cfb2fd
commit
98815d560f
27 changed files with 281 additions and 161 deletions
|
|
@ -119,9 +119,9 @@ class DetectionValidator(BaseValidator):
|
|||
if len(stats) and stats[0].any():
|
||||
self.metrics.process(*stats)
|
||||
self.nt_per_class = np.bincount(stats[-1].astype(int), minlength=self.nc) # number of targets per class
|
||||
metrics = {"fitness": self.metrics.fitness()}
|
||||
metrics |= zip(self.metric_keys, self.metrics.mean_results())
|
||||
return metrics
|
||||
fitness = {"fitness": self.metrics.fitness()}
|
||||
metrics = dict(zip(self.metric_keys, self.metrics.mean_results()))
|
||||
return {**metrics, **fitness}
|
||||
|
||||
def print_results(self):
|
||||
pf = '%22s' + '%11i' * 2 + '%11.3g' * len(self.metric_keys) # print format
|
||||
|
|
@ -198,7 +198,7 @@ class DetectionValidator(BaseValidator):
|
|||
names=self.names) # pred
|
||||
|
||||
|
||||
@hydra.main(version_base=None, config_path=DEFAULT_CONFIG.parent, config_name=DEFAULT_CONFIG.name)
|
||||
@hydra.main(version_base=None, config_path=str(DEFAULT_CONFIG.parent), config_name=DEFAULT_CONFIG.name)
|
||||
def val(cfg):
|
||||
cfg.data = cfg.data or "coco128.yaml"
|
||||
validator = DetectionValidator(args=cfg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue