§
    —/j+  ã                  ó:   — d dl mZ d dlmZ  G d„ de¦  «        ZdS )é    )Úannotations)ÚSegmentationValidatorc                  ó&   ‡ — e Zd ZdZddˆ fd„Zˆ xZS )ÚFastSAMValidatora·  Custom validation class for FastSAM (Segment Anything Model) segmentation in the Ultralytics YOLO framework.

    Extends the SegmentationValidator class, customizing the validation process specifically for FastSAM. 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 (torch.utils.data.DataLoader): The data loader object used for validation.
        save_dir (Path): The directory where validation results will be saved.
        args (SimpleNamespace): Additional arguments for customization of the validation process.
        _callbacks (dict): Dictionary of callback functions to be invoked during validation.
        metrics (SegmentMetrics): Segmentation metrics calculator for evaluation.

    Methods:
        __init__: Initialize the FastSAMValidator with custom settings for FastSAM.
    NÚ
_callbacksúdict | Nonec                ó€   •— t          ¦   «                              ||||¦  «         d| j        _        d| j        _        dS )aY  Initialize the FastSAMValidator class, setting the task to 'segment' and metrics to SegmentMetrics.

        Args:
            dataloader (torch.utils.data.DataLoader, optional): DataLoader to be used for validation.
            save_dir (Path, optional): Directory to save results.
            args (SimpleNamespace, optional): Configuration for the validator.
            _callbacks (dict, optional): Dictionary of callback functions to be invoked during validation.

        Notes:
            Plots for ConfusionMatrix and other related metrics are disabled in this class to avoid errors.
        ÚsegmentFN)ÚsuperÚ__init__ÚargsÚtaskÚplots)ÚselfÚ
dataloaderÚsave_dirr   r   Ú	__class__s        €úc/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/ultralytics/models/fastsam/val.pyr   zFastSAMValidator.__init__   s9   ø€ õ 	‰Œ×Ò˜ X¨t°ZÑ@Ô@Ð@Ø"ˆŒ	ŒØˆŒ	Œˆˆó    )NNNN)r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__)r   s   @r   r   r      sL   ø€ € € € € ðð ð" ð  ð  ð  ð  ð  ð  ð  ð  ð  ð  r   r   N)Ú
__future__r   Úultralytics.models.yolo.segmentr   r   © r   r   ú<module>r      s`   ðð #Ð "Ð "Ð "Ð "Ð "à AÐ AÐ AÐ AÐ AÐ Að  ð   ð   ð   ð   Ð,ñ   ô   ð   ð   ð   r   