mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 21:44:22 +08:00

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
15 lines
689 B
Python
15 lines
689 B
Python
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
|
|
from ultralytics.models.yolo.segment import SegmentationValidator
|
|
from ultralytics.utils.metrics import SegmentMetrics
|
|
|
|
|
|
class FastSAMValidator(SegmentationValidator):
|
|
|
|
def __init__(self, dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None):
|
|
"""Initialize SegmentationValidator and set task to 'segment', metrics to SegmentMetrics."""
|
|
super().__init__(dataloader, save_dir, pbar, args, _callbacks)
|
|
self.args.task = 'segment'
|
|
self.args.plots = False # disable ConfusionMatrix and other plots to avoid errors
|
|
self.metrics = SegmentMetrics(save_dir=self.save_dir, on_plot=self.on_plot)
|