─░├žeri─če ge├ž

Referans i├žin ultralytics/models/fastsam/val.py

Not

Bu dosya https://github.com/ultralytics/ultralytics/blob/main/ ultralytics/models/ fastsam/val .py adresinde mevcuttur. Bir sorun tespit ederseniz l├╝tfen bir ├çekme ─░ste─či ­čŤá´ŞĆ ile katk─▒da bulunarak d├╝zeltilmesine yard─▒mc─▒ olun. Te┼čekk├╝rler ­čÖĆ!



ultralytics.models.fastsam.val.FastSAMValidator

├ťsler: SegmentationValidator

Ultralytics YOLO ├žer├ževesinde h─▒zl─▒ SAM (Segment Anything Model) segmentasyonu i├žin ├Âzel do─črulama s─▒n─▒f─▒.

SegmentationValidator s─▒n─▒f─▒n─▒ geni┼čleterek do─črulama s├╝recini ├Âzellikle h─▒zl─▒ SAM i├žin ├Âzelle┼čtirir. Bu s─▒n─▒f g├Ârevi 'segment' olarak ayarlar ve de─čerlendirme i├žin SegmentMetrics'i kullan─▒r. Ayr─▒ca, ├žizim ├Âzellikleri devre d─▒┼č─▒ b─▒rak─▒l─▒r do─črulama s─▒ras─▒nda hatalar─▒ ├Ânlemek i├žin.

Nitelikler:

─░sim Tip A├ž─▒klama
dataloader

Do─črulama i├žin kullan─▒lan veri y├╝kleyici nesnesi.

save_dir str

Do─črulama sonu├žlar─▒n─▒n kaydedilece─či dizin.

pbar str

Bir ilerleme ├žubu─ču nesnesi.

args str

├ľzelle┼čtirme i├žin ek arg├╝manlar.

_callbacks str

Do─črulama s─▒ras─▒nda ├ža─čr─▒lacak geri arama i┼člevlerinin listesi.

Kaynak kodu ultralytics/models/fastsam/val.py
class FastSAMValidator(SegmentationValidator):
    """
    Custom validation class for fast SAM (Segment Anything Model) segmentation in Ultralytics YOLO framework.

    Extends the SegmentationValidator class, customizing the validation process specifically for fast SAM. This class
    sets the task to 'segment' and uses the SegmentMetrics for evaluation. Additionally, plotting features are disabled
    to avoid errors during validation.

    Attributes:
        dataloader: The data loader object used for validation.
        save_dir (str): The directory where validation results will be saved.
        pbar: A progress bar object.
        args: Additional arguments for customization.
        _callbacks: List of callback functions to be invoked during validation.
    """

    def __init__(self, dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None):
        """
        Initialize the FastSAMValidator class, setting the task to 'segment' and metrics to SegmentMetrics.

        Args:
            dataloader (torch.utils.data.DataLoader): Dataloader to be used for validation.
            save_dir (Path, optional): Directory to save results.
            pbar (tqdm.tqdm): Progress bar for displaying progress.
            args (SimpleNamespace): Configuration for the validator.
            _callbacks (dict): Dictionary to store various callback functions.

        Notes:
            Plots for ConfusionMatrix and other related metrics are disabled in this class to avoid errors.
        """
        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)

__init__(dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None)

FastSAMValidator s─▒n─▒f─▒n─▒ ba┼člat─▒n, g├Ârevi 'segment' ve metrikleri SegmentMetrics olarak ayarlay─▒n.

Parametreler:

─░sim Tip A├ž─▒klama Varsay─▒lan
dataloader DataLoader

Do─črulama i├žin kullan─▒lacak Dataloader.

None
save_dir Path

Sonu├žlar─▒ kaydetmek i├žin dizin.

None
pbar tqdm

─░lerlemeyi g├Âr├╝nt├╝lemek i├žin ilerleme ├žubu─ču.

None
args SimpleNamespace

Do─črulay─▒c─▒ i├žin yap─▒land─▒rma.

None
_callbacks dict

├çe┼čitli geri arama i┼člevlerini saklamak i├žin s├Âzl├╝k.

None
Notlar

ConfusionMatrix ve di─čer ilgili metrikler i├žin grafikler, hatalar─▒ ├Ânlemek i├žin bu s─▒n─▒fta devre d─▒┼č─▒ b─▒rak─▒lm─▒┼čt─▒r.

Kaynak kodu ultralytics/models/fastsam/val.py
def __init__(self, dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None):
    """
    Initialize the FastSAMValidator class, setting the task to 'segment' and metrics to SegmentMetrics.

    Args:
        dataloader (torch.utils.data.DataLoader): Dataloader to be used for validation.
        save_dir (Path, optional): Directory to save results.
        pbar (tqdm.tqdm): Progress bar for displaying progress.
        args (SimpleNamespace): Configuration for the validator.
        _callbacks (dict): Dictionary to store various callback functions.

    Notes:
        Plots for ConfusionMatrix and other related metrics are disabled in this class to avoid errors.
    """
    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)





Created 2023-11-12, Updated 2024-06-02
Authors: glenn-jocher (5), Burhan-Q (1)